On 2017-10-28 09:53, Ed Leafe wrote:
On Oct 28, 2017, at 7:58 AM,
[email protected] wrote:
I don't do that but I thought using varchar(n) fields were supposed to
be space-efficient in a sense that it just used a extra 1 or 2 bytes
up front at the head of the record to identify the true length? It's
not really allocating the space like a CHAR(n) field would...right?
Yes, it only uses the space needed for the value. Again, the primary
concern isn't disk storage space, but indexing. If you have *any*
variable-width columns in a table, the table no longer has fixed
record length, so you lose the fixed offset for searching. The moral
of the story is if you use VARCHAR anywhere in a table, you might as
well make all string columns VARCHAR.
Hi Ed,
Yep...I recall hearing that years ago, too (regarding any varchars make
the whole row a varchar in string fields, basically).
Would you ever use fixed CHARs with a non-VFP backend for that fixed
offset advantage, again with the idea that storage is cheap/available?
tia,
--Mike
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.