[fpc-pascal] Documentation for sqldb - More Questions

Michael Van Canneyt michael at freepascal.org
Tue Jul 3 18:32:33 CEST 2007

On Tue, 3 Jul 2007, Joost van der Sluis wrote:

> On Tue, 2007-07-03 at 17:38 +0200, Michael Van Canneyt wrote:
> > > What I do like is the idea of storing strings in a
> > > widestring/ansistring. I tried to implement that earlier, but it's
> > not
> > > doable in a Delphi-compatible way. As you said, you don't have that
> > > problem. But it's still something on my whish-list for
> > > sqldb/TDataset/TBufDataset. There must be a solution, without using
> > the
> > > blob-system...
> > 
> > I do not think this is a good idea: the amount of memory used for this
> > is 
> > a multiple of the classic buffer scheme, the heap will be terribly
> > fragmented.
> > The buffer system is exactly meant to save memory (blobs excepted).
> Do you think? Using the buffer, there's a lot of memory which isn't
> used. 

Not more than when using ansistrings - or worse, widestrings - to 
store the string data. You forget the heap overhead and ansistring 
"hidden" data, plus the whole reference counting mechanism.

> I thought about adding a new kind of fieldtype, for example
> ftAnsiString which you could use for larger strings.
> But maybe you can use a ftMemo in that case....

Memo is very special and hard to handle in grids and the like.

See my private mail to you for a more detailed calculation. 

> > > What do you mean with the local change log and data file?
> > 
> > Like TClientDataset: the changes to the records (the delta) are kept
> > in a 
> > separate index. All can be written to file. It's a briefcase model.
> I thought so. TBufDataset also has that, it can't save it to file,
> though. But that's easy to implement.

Indeed. All one needs is some time :-)


More information about the fpc-pascal mailing list