Rev cgi & mySQL (again) -- Valentina Server have server side cursors

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jan 3 04:40:30 EST 2009


On 1/3/09 2:03 AM, "Bob Sneidar" <bobs at twft.com> wrote:

Hi Bob,
Hi All,

> I have always toyed with the idea of writing a paging query system
> which paged through a large SQL database. The idea would be that you
> only have one live cursor but 2 or 3 "pages" (cursors) forward and
> back. As the user scrolls past the current page you silently swap the
> pointer to the current page, flush the farthest page back and query
> the next forward page. This would give the user the "appearance" of
> good performance paging through the data while minimizing the workload.

In fact if you will use Valentina Server, there is no need to break fingers
and head on a task which already solved :-)

In Valentina Server we offer both

* client side cursors (mySQL have only such)
* server side cursors

In nearest few months we will introduce also more improvements in cursor
navigation and client-side record caching.

--
TIPs:

For very complex queries that return unpredicted results in size, good are
server side cursors.

* This is better than using LIMIT. Because using limit you at least loose
information about HOW MANY records really was found. And you cannot show
then correct scrollbar.

* also server side cursors can be READ-WRITE, while client side cursors are
read-only. Why this is good? Because image such often task:
    * you have query db.
    * Get N records.
    * show them in listbox
    * Now user want EDIT SOME Nth record. Let even only ONE field.

Using mySQL or SqlLite you must produce UPDATE query, send it, then again
execute big original query to get back changes into new cursor.

Using server side cursors and API of Valentina you can do only

    curs.Field( "f1" ).value = NewValue
    curs.UpdateRecord

That is all, you have now updated db on server, and fresh values in cursor
which you still show in the GUI.


P.S. Yes, actually Bob describe above task of pre-load of some not visible
records. But to be able execute such task you must have SERVER SIDE cursors
instead of client-side.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]





More information about the use-livecode mailing list