>>>>> "Willem" == Willem Bison <[EMAIL PROTECTED]> writes:

Willem> I want to speedup a simple query like:
Willem>  select * from tableX where id=<n>
Willem> where 'id' is the primary key.

Willem> tableX now has variable length records.
Willem> Does it help if I make it fixed length (at the cost of space) ?

Yes; Fixed size rows are usually 20-30 % faster.

Willem> If, at least theoretically, it does go faster with fixed length
Willem> fields can someone explain why ?

Dynamic length row has the extra overhead of reading the size of the
row for each accesses rows;  This requires an extra system call.

There is also the overhead to convert the dynamic record length to the
fixed record length that is used internally.

Dynamic rows can also be split in many parts, which requires
multiple seeks to find the whole row.

Willem> Doesn't the indexing take care of finding the desired record
Willem> regardless of the length of each record ?

No.  The index only points to the start of the record.

Regards,
Monty

-----------------------------------------------------------
Send a mail to [EMAIL PROTECTED] with
unsubscribe mysql [EMAIL PROTECTED]
in the body of the message to unsubscribe from this list.

Reply via email to