dbf/cdx Limits

This forum is meant for questions and discussions about the X# language and tools
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

dbf/cdx Limits

Post by Horst »

Hallo
I was looking in the X# help for the limits of the dbf/cdx . Like max. size of a dbf, max records , max. length of a charater field etc.
I cant find it, any hint ?

Horst
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

dbf/cdx Limits

Post by robert »

Horst
Horst wrote: I was looking in the X# help for the limits of the dbf/cdx . Like max. size of a dbf, max records , max. length of a charater field etc.

We follow the same specs as FoxPro and the other DBFCDX implementations:

DBF Max 2 Gb
FPT Max 2 Gb
CDX Max 2 Gb
Record Size Max 64 K
# of Fields: 255
Max # of Characters in field: 254, however you can have more by storing length and decimals for a field. That will make the table incompatible with FoxPro
Max size of index key: 240
Max size of index expression + for condition expression: 512
I will make a note to add a page to the help file about this.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

dbf/cdx Limits

Post by Horst »

Hallo Robert

Thanks, i was already using the dbf with a fieldsize of 1000, was hoping for more :-)

Horst
Jamal
Posts: 315
Joined: Mon Jul 03, 2017 7:02 pm

dbf/cdx Limits

Post by Jamal »

Robert,

Are you sure about the # of Fields: 255 ?

I have a DBF file with 336 fields.

Jamal
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

dbf/cdx Limits

Post by wriedmann »

Hi Robert,
AFAIK the maximum number of fields in a table is 1024, but I cannot find any reference of it. The programmers guide where this page was seems to have been lost in 2.8 SP4.
DBaseIV for DOS says 255, DBaseIV for Windows says 1024.
My largest table currently has 503 fields.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

dbf/cdx Limits

Post by robert »

Wolfgang,
There is no field in the DBF header with the # of fields. So that does not result in a limit. There is a field with the header size which is 16 bits. The start of the header is 32 bytes and each field is also 32 bytes. If you see the header size as unsigned then you can store (2^16 - 32 ) / 32 = 2046 fields in there. I think the 1024 you mention should actually be 1022 and is based on signed numbers
If the DBF is part of a FoxPro DBC file then an additional 262 bytes in the header are reserved for the link to the DBC, so you will be able to store less fields.
The # of fields that I have was based on the FoxPro specs.
There is also a field in the header of the DBF with the record size. This is also 16 bits, so that determines the max 64K record size.
The 2 Gb file sizes are based on the locking scheme (for DBF) and on the fact that page offsets are stored in the CDX as signed integers.
Harbour has the option to store page numbers instead of offsets in a CDX (these CDX files are incompatible with FoxPro) which allows for much larger CDX files (1 Tb). They also have a special custom locking scheme for the DBF files that allows for MUCH larger DBF files sizes. I am not sure if that is such a good idea though.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

dbf/cdx Limits

Post by Horst »

Hi Robert
One little question. VO and X# dbf's are the same ?
So i can still use dbalite to create dbf's ?
Or its better to create them with x# ?

Horst
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

dbf/cdx Limits

Post by FFF »

Wolfgang,i found the text in my old 2.5 ProgGuide copy ;-)
DBF_Spec_1.png
DBF_Spec_1.png (151.4 KiB) Viewed 856 times
What the heck does this site do to attachments? I upload a gif, and it makes it a png, and a bad one ;-(
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

dbf/cdx Limits

Post by Chris »

Hi Horst,

Dbfs in X#/VO should be usable in the exact same way. Almost any difference regarding dbf usage between the two is most probably a bug that we'd need a sample to look into it and fix it.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

dbf/cdx Limits

Post by Horst »

Hi Chris
Thanks for the pic. I have one 'static' dbf , the dbf grows up to about 500 records and then records will be receicled , But the fpt files still grows up and up. now i can define a charaterfield with 30kb and i have no additional work on that dbf.

Thanks
Horst

btw
i think i saw this table in the vo2.7 help, i lost that file
Post Reply