SQL and API methods + benchs

Olivier vidal_olivier at yahoo.fr
Mon Jan 24 11:30:26 CST 2005


>> At the moment, SQL is much faster. Maybe that I have badly to 
>> optimize my code
>> for the API.
>
> I also think so. It needs study your task.
> For now quick notes:
>
> 1) have you bench with DebugLevel = 0 ?
>
I try with. That changes nothing

> 2) as far as I see, in the SQL you SELECT all fields of table Zipcity,
> Right?
>
> Actually SQL way have interesting feature:
>     Let you have table with 20 fields,
>     but you select only 4 fields.
>
>     then Iteration of cursor will be 5 times faster of iteration
>     of original table, because cursor will read only that 4 fields.
>
interesting, but Here that does not modify the bench.
There are only two fields in the table. Both are selected.
SQL and API are thus equally on this point.

>     For now we do not have way do the same trick in API.
>     (in C++ we have in fact, just did not opened to V4RB.)
>
> 3) API way has other name -- Navigational way.
>     this means that you should walk from record to record.
>     this means that you can touch ONLY really required records.
>
>  SQL way in contrast is oriented on the work with SETS of records.
>  you find set of records WHERE.
>  you UPDATE set of records WHERE.
>  you join SET1 to SET2 of T1 and T2..
>  and so on.
>
> This is the main difference in the ideology of these ways.
> Valentina although try optimize API way to SETs also.
> The old Navigational dbs (like dbVista) cannot do this absolutely.

Thus if I want to seek and to display in a listbox a big set of 
records, I use rather SQL?

What is strange in my example, it is that SQL is much faster.
The API is thus faster only for certain processings?

thank you

olivier
>



More information about the Valentina-beta mailing list