Subject Re: how do i speed this up?
Author martinknappe
> Hi Martin!

Hi Set :-)
> you may be able to speed up your query a bit by simplifying and
> changing to
>
> select first 1 id from dicentries
> where asterm is not null and id+0 > 0
> /*I think '' is less than any other value, so no need for OR*/
> order by asterm, id

that speeds it up *slightly* (by like 1 sec *lol)
>
> Though I think that to make it quick, you better split your request
> into two separate requests:
>
> select min(asterm) from dicentries
> where asterm is not null and id+0 > 0

It seems like min works only on numbers -> this query returns min =
null!!!
> //May use an index on asterm and can be quick

The problem here is I have a terminology database application and now
I need to write a client application that requests the entries from
the database in a sequential manner and outputs them in a
dictionary-like style into an RTF file. The user needs to have the
possibility to configure the sorting of the entries in the rtf file
(i.e. be it by source language, target target language, and more), so
simply defaulting to the primary key is not an option
On the other hand, of course, the client application cannot request
the whole result set all at once because it wouldnt fit into memory..
ive seen this same kind of application done with the bde where you
were also able to switch indices as you please and it was way
faster..bde is pretty old so i cant really believe that firebird
shouldn't be able to do it equally fast
admittedly, the bde database didnt contain several different tables
referring to each other like this one does, but as you can see, this
very query requires no searching in any other table so there should be
a quicker way to find the first entry that meets the condition
i dont have *too* much of an idea of sql i must admit so i
suppose/hope there's still some better way to formulate my query

thanx,

martin