[fpc-devel] Warning for sqldb and fpc 2.1.1 users

Luiz Americo Pereira Camara pascalive at bol.com.br
Sat Apr 1 23:33:10 CEST 2006


Micha Nelissen escreveu:
> On Sat, 01 Apr 2006 18:06:31 +0200
> Joost van der Sluis <joost at cnoc.nl> wrote:
>
>   
>> Further I have a question: now sqldb uses a linked-list record buffer,
>> the RecordCount and RecNo properties are something strange.
>>
>> What should I do with recordcount? I can add a counter which keep track
>> of the recordcount. Ie: it does inc(recordcount) if a record is
>> appended.
>>     
>
> Keep a counter.
>  
>   
>> Or I can do a real count of the records, each time recordcount is
>> called.
>>     
>
> No, too slow.
>
>   
>> And what about recno? Just define it as -1, or do a quick count to get
>> the current record number?
>>     
Take a look at TCustomSqliteDataset implementation. In its 
implementation a count is done each time.
> Store the recno with/in the linked list entry ?
>
>   
It has two drawbacks: increase memory usage and when inserting, deleting 
all following records must be updated.

Luiz





More information about the fpc-devel mailing list