Subject Re: First word after in alphabetical order
Author Adam
--- In firebird-support@yahoogroups.com, Eric SIBERT <courrier@e...>
wrote:
> Helen Borrie wrote:
> >>- I am using IBOConsole with interactive SQL for my test
> >
> >
> > Run your test at the command line using isql and compare timings
with those
> > across the wire to a GUI interface.
>
> YES. That's it.
>
> SELECT FIRST 11
> ID_WAYPOINT
> FROM WAYPOINTS
> WHERE WP_NOM>='CHAMBER'
> ORDER BY WP_NOM;
>
> With IBOConsole : 100 s.
> With isql : 5 s.
> With IBConsole : 5 s.
>
> My Celeron is back a young mustang ;-)

LOL, I remember trying to run Linux (RH, SUSE, Mandrake) on a P200 a
while back. It liked a lot more RAM than win98 needed on the same box.

>
>
> > Walking 5 million rows three times (two SELECT FIRSTs and then the
> > elimination of duplicates for the union) is NOT likely to produce a
> > lightning fast result.
>
> The problem is walking three times the table to find rows which are
near
> each other in the index. My knowledge in databases is not enough to
know
> if this can be optimized or not when using SQL queries.

Jump back into IBOConsole and take a look at the PLAN for the queries.
I do know from experience that a select first n takes just as long in
execution time as without the first n, but the fetch time is much
better (obviously).

I would rethink the process a little. I mean do they really want the
10 records following chamber, or do they want the first 10 records
between chamber and chambeu etc.

Adam