MySQL Forums
Forum List  »  Optimizer & Parser

Re: Query speed and columns per table
Posted by: Rick James
Date: May 19, 2009 08:39PM

"Count the disk hits". And "count the bytes transferred".

Probably the CPU is not the gating issue, but rather disk I/O and/or network bandwidth.

Not a simple formula? Don't forget about caches, etc.

Factors involved:
* Disk hits -- more data -> more time
* Bytes in each column -- again more data -> more time; example: INT takes 4 bytes; TINYINT takes 1
* Padding in blocks (eg, from deleting records)
* Row overhead -- 100 rows with 10 columns takes more 'effort' than 10 rows with 100 columns.
* etc.

To assist in analyzing slow SELECTs, please provide
* SHOW CREATE TABLE tbl\G
* SHOW TABLE STATUS LIKE 'tbl'\G
* EXPLAIN SELECT ...\G
and surround them with [ code ] and [ / code ]

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query speed and columns per table
2228
May 19, 2009 08:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.