Re: [fpc-pascal] New local-indexes support for sqldb

2008-02-16 Thread Joost van der Sluis
Op woensdag 13-02-2008 om 14:59 uur [tijdzone -0600], schreef Jesus
Reyes:
 --- Joost van der Sluis [EMAIL PROTECTED] escribió:
 
  Hi all,
  
  fpc 2.3.1 and 2.2.1 now have local indexes support for sqldb.
  (TBufDataset)
  
  I would like it if you can test if it works ok for you before we
  release
  fpc 2.2.2.
  
 
 Maybe is not related to this feature but there seems to be mem leak:
 
 Call trace for block $4049E860 size 135
   $08070601  TRACEALLOCMEM,  line 1177 of ../inc/heaptrc.pp
   $08066DA4  ALLOCMEM,  line 295 of /home/prog/fpc/rtl/inc/heap.inc
   $0826C3E5  TBUFDATASET__INTALLOCRECORDBUFFER,  line 625 of
 bufdataset.pas

Can you test if it's fixed in r10340?

Joost

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] New local-indexes support for sqldb

2008-02-16 Thread Jesus Reyes

--- Joost van der Sluis [EMAIL PROTECTED] escribió:

 Op woensdag 13-02-2008 om 14:59 uur [tijdzone -0600], schreef Jesus
 Reyes:
  --- Joost van der Sluis [EMAIL PROTECTED] escribió:
  
   Hi all,
   
   fpc 2.3.1 and 2.2.1 now have local indexes support for sqldb.
   (TBufDataset)
   
   I would like it if you can test if it works ok for you
 before we
   release
   fpc 2.2.2.
   
  
  Maybe is not related to this feature but there seems to be mem
 leak:
  
  Call trace for block $4049E860 size 135
$08070601  TRACEALLOCMEM,  line 1177 of ../inc/heaptrc.pp
$08066DA4  ALLOCMEM,  line 295 of
 /home/prog/fpc/rtl/inc/heap.inc
$0826C3E5  TBUFDATASET__INTALLOCRECORDBUFFER,  line 625 of
  bufdataset.pas
 
 Can you test if it's fixed in r10340?
 
 Joost
 

It is, :)

Thanks.

Jesus Reyes A.


  

¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:  

http://correo.yahoo.com.mx/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] New local-indexes support for sqldb

2008-02-13 Thread Jesus Reyes

--- Joost van der Sluis [EMAIL PROTECTED] escribió:

 Hi all,
 
 fpc 2.3.1 and 2.2.1 now have local indexes support for sqldb.
 (TBufDataset)
 
 I would like it if you can test if it works ok for you before we
 release
 fpc 2.2.2.
 

Maybe is not related to this feature but there seems to be mem leak:

Call trace for block $4049E860 size 135
  $08070601  TRACEALLOCMEM,  line 1177 of ../inc/heaptrc.pp
  $08066DA4  ALLOCMEM,  line 295 of /home/prog/fpc/rtl/inc/heap.inc
  $0826C3E5  TBUFDATASET__INTALLOCRECORDBUFFER,  line 625 of
bufdataset.pas
  $0826C4AC  TBUFDATASET__INTERNALOPEN,  line 654 of bufdataset.pas
  $0825374D  TCUSTOMSQLQUERY__INTERNALOPEN,  line 1208 of sqldb.pp
  $0825930E  TDATASET__DOINTERNALOPEN,  line 387 of dataset.inc
  $0825A3C8  TDATASET__OPENCURSOR,  line 868 of dataset.inc
  $0825A757  TDATASET__SETACTIVE,  line 965 of dataset.inc
Call trace for block $4049E2B0 size 133
  $08070601  TRACEALLOCMEM,  line 1177 of ../inc/heaptrc.pp
  $08066DA4  ALLOCMEM,  line 295 of /home/prog/fpc/rtl/inc/heap.inc
  $0826C3E5  TBUFDATASET__INTALLOCRECORDBUFFER,  line 625 of
bufdataset.pas
  $0826C4AC  TBUFDATASET__INTERNALOPEN,  line 654 of bufdataset.pas
  $0825374D  TCUSTOMSQLQUERY__INTERNALOPEN,  line 1208 of sqldb.pp
  $0825930E  TDATASET__DOINTERNALOPEN,  line 387 of dataset.inc
  $0825A3C8  TDATASET__OPENCURSOR,  line 868 of dataset.inc
  $0825A757  TDATASET__SETACTIVE,  line 965 of dataset.inc

Jesus Reyes A.


  

¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:  

http://correo.yahoo.com.mx/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] New local-indexes support for sqldb

2008-02-12 Thread Joost van der Sluis
Hi all,

fpc 2.3.1 and 2.2.1 now have local indexes support for sqldb.
(TBufDataset)

I would like it if you can test if it works ok for you before we release
fpc 2.2.2.

Usage is pretty simple. For example use
ASQLQuery.AddIndex('indexname','lastname,firstname); to add an index
named 'indexname' ordered by the fields lastname,firstname.

Then set the active index to this index using: ASQLQuery.IndexName :=
'indexname'; If you do this and the dataset is active the current
record will stay the same. But the records before and after it can
differ, offcourse.

You can add as many indexes as you want, as long as the TSQLQuery is
closed. When TSQLQuery is opened, you can add up to
TSQLQuery.MaxIndexesCount indexes. You can set the value of this
property when the dataset is closed.
This is because the memory for each indexes is allocated at the moment
that the TSQLQuery is opened. 

The default value of MaxIndexesCount is 2. By default there is always
one default index, which maintains the order in which the records are
loaded into memory. And there is a temporary index. 

To use this temporary index, you can simply set
TSQLQuery.IndexFieldNames to the fields you want to base the index on.
When you do that the dataset is automatically uses a temporary index
based on that field. If you don't want to use this index anymore, set
the property to an empty string, or set the IndexName property to
another index.

After the data is loaded into memory after open, the indexes are build
using a mergesort algorithm.

When you edit (or append/insert) a record, the record is placed into the
right place of all indexes when 'TSQLQuery.Post' is called. (which is
called automatically before you scroll throught the database, or closes
it)

To see which local indexes are defined, you can use 'tsqlquery.indexes'.
Not that the sqldb version from fpc 2.2.0 stored the index-definitions
on the server in that place. Now you can find these index-definitions in
the TSQLQuery.ServerIndexDefs property.

These local indexes are not (yet) used for searching records. And it's
not possible to search case-insensitive or partially. That'll be
implemented soon.

I hope that this is enough information to give a head start... ;)


Joost.

(for the purists: the local-indexes are implemented in TBufDataset, not
TSQLQuery.)






___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal