[Wolves] mysql select help

Andy D'Arcy Jewell andy.jewell at sysmicro.co.uk
Wed Mar 14 08:08:28 UTC 2012


> I would be sceptical of the planners ability to make that kind of
> optimisation.  Generally
> sorts are post processing on the query, along with limits.  This will
> require more work than
> an aggregate and may need to spill to disk, certainly for large result sets.
>
> Given the number of rows we are talking, an Index would make little
> difference, possibly reduce
> the performance.  The table will be small, it will fit in RAM, a
> sequential read of the table will be far
> quicker than the random IO of an index scan.
>
> This is certainly true for PostgreSQL, the PostgreSQL planner will
> rarely do an index scan on a
> small table, for those reasons.
>
> Mailing list home: https://mailman.lug.org.uk/mailman/listinfo/wolves

MySQL will not use indexes when querying tables which fit wholly in 
memory, although it will of course keep them up to date during inserts, 
so they are really just an overhead on genuinely small tables. The 
online MySQL manual gives a thorough discussion of how this works (look 
up "optimizing queries").

-- 
Andy D'Arcy Jewell

SysMicro Limited
Linux Support





More information about the Wolves mailing list