MySQL Forums
Forum List  »  Optimizer & Parser

Re: NOP optimises Group By?
Posted by: Rick James
Date: September 11, 2010 01:22PM

The answer probably lies in the indexes; please provide
* SHOW CREATE TABLE tbl\G -- engine, indexes
* SHOW TABLE STATUS LIKE 'tbl'\G -- sizes
* EXPLAIN SELECT ...\G -- clues of inefficiencies
* SHOW VARIABLES LIKE '%buffer%'; -- cache size
and surround them with [ code ] and [ / code ]

What is "[PercentExtend]" ??

Your queries, cleaned up a bit:
SELECT  v.PointId,
        Sum((100-[PercentExtent]))/523  AS Weight,
        Count(*)  AS SppCount
    FROM  sppmodelvalues v
    INNER JOIN  spphistograms h
           ON     (v.SppId = h.SppId)
             AND  (v.Prob  = h.Prob)
    WHERE  v.SppId > 0         -- the No-op
    GROUP BY  v.PointId;

I would hope for indexes on both tables of (SspId, Prob) or (Prob, SspId).
sppmodelvalues might benefit from INDEX(SspId, Prob, PointId)

Options: ReplyQuote

Written By
September 05, 2010 08:16PM
Re: NOP optimises Group By?
September 11, 2010 01:22PM
September 12, 2010 11:09PM
September 13, 2010 10:56AM
September 13, 2010 08:15PM
September 13, 2010 10:46PM

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.