Re: Largest field size
| From: | Doug Semig | Date: | Tue, 11 Jul 2000 10:18:41 +0000 |
| Subject: | Re: Largest field size | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1026@lists.php.net to get a copy of this message | ||
You'll want to look in the manual for your chosen RDBMS. There seems to be
some kind of conspiracy in lots of RDBMSs to limit the number of characters
in a varchar field to 255 (which happens to be the largest positive number
you can fit into an unsigned single byte, indicating to me that they could
be using pascal-like strings with a one-byte length preceeding the actual
string).
I'm unsure if this is an ANSI specification for SQL, because I haven't read
the actual ANSI docs about SQL. But it seems to me they wouldn't have set
a maximum number of characters in a varchar. Anyone familiar with the ANSI
specs know about this?
There are popular alternatives, however:
* BLOBs (binary large objects) are used to store arbitrary-length data,
but be careful because there may be limits on the size of BLOBs depending
upon your chosen RDBMS.
* Just keep the text in a regular file and store just the filename in
the database. This is useful if you want to allow folks to search through
the actual text in the files in search engine fashion because you can use
htdig to index the files.
Doug
At 12:19 AM 7/11/00 +0100, Tim wrote:
>Newbie here I'm afraid: What is the largest feasible size that I can make a
>text field? Is there is a size beyond which everything goes too slowly?
>
>Thanks in advance for any help... :o)
>