On Sun, Apr 6, 2008 at 9:57 PM, Eric Bergen <[EMAIL PROTECTED]> wrote:
> I don't see what the issue is. As Jay said the row counts in explain
>  outputs are estimates. When running an explain query MySQL asks the
>  storage engine how many rows it thinks are between a set of values for
>  an index. Different storage engines use different methods to calculate
>  row count. Both innodb and myisam estimate the row count  based on
>  statistics they keep on the distribution of keys in an index. MyISAM
>  is more accurate than innodb with it's row count because of how it
>  keeps statistics. Analyze table on a myisam table will count the
>  number of unique values in an index
>  (myisam/mi_check:update_key_parts). Innodb samples the key
>  distribution in 8 different pages per index and does some calculations
>  based on the tree structure of those pages (details
>  innobase/btr/btr0cur.c:btr_estimate_number_of_different_key_vals).

Thank you! I spent a bit trying to find details about how row counts
were computed, but with no luck (I probably did not know how to know
how to look...). Could the alternative I had proposed be accurate at
all?

-- 
Rob Wultsch
[EMAIL PROTECTED]
wultsch (aim)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to