Re: Innodb vs myisam
- Date: Tue, 8 Apr 2008 11:36:18 +0530
- From: "Krishna Chandra Prajapati" <prajapatikc@xxxxxxxxx>
- Subject: Re: Innodb vs myisam
Thanks a lot
On Mon, Apr 7, 2008 at 10:59 AM, Rob Wultsch <wultsch@xxxxxxxxx> wrote:
> On Sun, Apr 6, 2008 at 9:57 PM, Eric Bergen <eric@xxxxxxxxxxxxxxxxx>
> 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@xxxxxxxxx
> wultsch (aim)
>
--
Krishna Chandra Prajapati