List:General Discussion« Previous MessageNext Message »
From:Jeremy Zawodny Date:June 9 2003 5:50pm
Subject:Re: arrangement of fields in a table
View as plain text  
On Mon, Jun 09, 2003 at 01:40:47PM -0400, Mojtaba Faridzad wrote:
> Hi,
> 
> I need to define for example 100 fields in a table. 8 of them are more
> important and many queries just need these fields. Should I define them
> before the other fields in the table or it doesn't matter? Is accessing the
> the beginning fields faster than the other fields?

What's most important is that you define the consecutively.  It'll
minimize the number of disk seeks necessary (on average) to retrieve
them.

Out of reading convenience, though, I'd put them at the beginning.
I'm a firm believer in putting the most important stuff first just as
a way of self-documenting my database tables.

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@stripped>  |  http://jeremy.zawodny.com/

MySQL 4.0.13: up 6 days, processed 195,455,826 queries (350/sec. avg)
Thread
Fw: 2 questions about indexing and testing speedMojtaba Faridzad9 Jun
  • arrangement of fields in a tableMojtaba Faridzad9 Jun
    • Re: arrangement of fields in a tableJeremy Zawodny9 Jun
    • Re: arrangement of fields in a tableNils Valentin10 Jun
  • Re: Fw: 2 questions about indexing and testing speedVictoria Reznichenko10 Jun
Re: Fw: 2 questions about indexing and testing speedrich johnson10 Jun
  • INT typeMojtaba Faridzad10 Jun
    • Re: INT typeDan Nelson10 Jun
RE: INT typeMike Hillyer10 Jun
  • Re: INT typeMojtaba Faridzad10 Jun
    • Re: INT typePaul DuBois10 Jun
    • Re: INT typeDan Nelson10 Jun