[fpc-pascal] sqldb how to find a record fast with primary key

Martin Schreiber mse00000 at gmail.com
Wed Oct 19 17:10:52 CEST 2011


On Wednesday 19 October 2011 16.53:00 Felipe Monteiro de Carvalho wrote:
> Hello,
> 
> I am using sqldb to connect to a postgres database. Using wiki
> instructions, my final object is a TSQLQuery for each table. So, this
> basically is a TDataset and to read fields I know that I can use
> First(), Next(), EOF() and RecNo
> 
> But these are rather slow. Many fields in the tables refer to the
> primary key in other tables, which does not match the RecNo. How can I
> jump fast a table to the record which has a particular PrimaryKey?
> 
Use a local index and tlocalindex.find() (MSEgui). SQLdb has local index too 
AFAIK.
MSEgui has additionally tlookupbuffer and fast lookup field linking by local 
index and direct data access without dataset scrolling.

Martin



More information about the fpc-pascal mailing list