Alaska Software Inc. - Maximum Index Tags in CDX Files
Username: Password:
AuthorTopic: Maximum Index Tags in CDX Files
Osvaldo Luis AokiMaximum Index Tags in CDX Files
on Mon, 20 Feb 2017 20:47:13 +0100
Hi,

  Anyone can tell me what is the maximum number of TAGs per CDX file using 
Visual Foxpro dbf files ?

  Thanks
  Osvaldo
Klaus OverhageRe: Maximum Index Tags in CDX Files
on Tue, 21 Feb 2017 07:21:06 +0100
Hi,

i use up to 24 Tags, but i don' know the max.

Am 20.02.2017 um 20:47 schrieb Osvaldo Luis Aoki:
> Hi,
>
>   Anyone can tell me what is the maximum number of TAGs per CDX file using
> Visual Foxpro dbf files ?
>
>   Thanks
>   Osvaldo
>
Andreas Gehrs-Pahl
Re: Maximum Index Tags in CDX Files
on Tue, 21 Feb 2017 07:33:46 -0500
Osvaldo,

>Anyone can tell me what is the maximum number of TAGs per CDX file using 
>Visual Foxpro dbf files ?

There is no (apparent) limitation to the number of Index Tags in a CDX file, 
but there are some other limitations, which might affect this, such as the 
maximum file size of 2 GB. Individual Index Tag Names must not be longer 
than 10 characters, while the individual Index Tag Expressions must not be 
longer than 512 characters, including any FOR expressions. IDX files support 
only 220 characters each for Index and FOR expressions.

The length of an Index Key (value) cannot exceed 240 bytes, if the ASCII 
Collation table is specified/selected, or 120 bytes for any other Collation 
table -- minus one byte, if any indexed field supports NULL values.

As a rule of thumb, I usually limit the number of Index Tags per CDX file to 
something around 10 Tags, mainly for performance reasons. Also, keep in mind 
that if you add a new Tag to a CDX file, using OrdCreate() (or INDEX ON), 
any existing Tags with the same name are not automatically removed or simply 
replaced, but instead a new copy is added (at the end of the CDX file).

So, if you don't want to run up against the 2 GB file size limit (and to 
improve performance), make sure you delete the CDX file, before re-creating 
it, or use OrdDestroy() (or DELETE TAG)) to remove an existing Index Tag 
from the file before adding it again. You can also use OrdListRebuild() (or 
REINDEX) to recreate an Index file, but based on (bad) experiences, I never 
use the delete or reindex options in a production environment.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC