List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:June 23 2004 8:03pm
Subject:Re: Fetching 12 columns or 1 TEXT field?
View as plain text  
In the last episode (Jun 23), Eamon Daly said:
> Which do you folks think is faster: randomly accessing a table with a
> primary key and a dozen CHAR columns or a table with a primary key
> and a single merged TEXT column? The data in the 11 extra columns
> will always be fetched as a single request.
> 
> I rolled my own benchmarking program and 10,000 runs each came out
> just about equal, which surprised me a little.

Probably because each disk seek takes much longer to complete than the
difference between processing 1 and 12 fields.  Timing a sequential
walk through the table may show more of a difference.  You probably
won't see much difference in table size between the two, either, since
a VARCHAR requires length(field)+1 bytes of storage, and you would need
to put a delimiter between your fields in the TEXT column.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Fetching 12 columns or 1 TEXT field?Eamon Daly23 Jun
  • Re: Fetching 12 columns or 1 TEXT field?Dan Nelson23 Jun
  • Re: Fetching 12 columns or 1 TEXT field?Frank Bax24 Jun
    • Re: Fetching 12 columns or 1 TEXT field?Eamon Daly24 Jun
      • Re: Fetching 12 columns or 1 TEXT field?Eric Bergen24 Jun