List:General Discussion« Previous MessageNext Message »
From:Rob Wultsch Date:April 7 2008 5:29am
Subject:Re: Innodb vs myisam
View as plain text  
On Sun, Apr 6, 2008 at 9:57 PM, Eric Bergen <eric@stripped> 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
wultsch@stripped
wultsch (aim)
Thread
Innodb vs myisamKrishna Chandra Prajapati2 Apr
  • Re: Innodb vs myisamRob Wultsch2 Apr
    • Re: Innodb vs myisamKrishna Chandra Prajapati3 Apr
      • Re: Innodb vs myisamRob Wultsch3 Apr
      • Re: Innodb vs myisamJay Pipes3 Apr
        • Re: Innodb vs myisamMoon's Father7 Apr
          • Re: Innodb vs myisamEric Bergen7 Apr
            • Re: Innodb vs myisamRob Wultsch7 Apr
              • Re: Innodb vs myisamKrishna Chandra Prajapati8 Apr
  • Re: Innodb vs myisamJay Pipes2 Apr
    • Re: Innodb vs myisamRob Wultsch2 Apr
      • Re: Innodb vs myisamKrishna Chandra Prajapati3 Apr