MySQL Forums
Forum List  »  InnoDB

How might I induce mysql 5.6.x to perform better here
Posted by: Eric Goff
Date: January 24, 2018 03:11PM

I have a table like so:

foo:
a int
b int
c int

With 163M rows
I have a partition on "a"
I have an index on "b"

If I run a query like so:
select b,sum(c) where a=4 group by 1 ;

I get a full scan of the partition.

If (using JDBC) I do repeated scans against ranges of "b" i.e.
select b,sum(c) where a=4 where b between 1 and 100 group by 1 ;
select b,sum(c) where a=4 where b between 101 and 200 group by 1 ;
etc..
to max value of "b".

combining the sums at the end I get much better performance.
If I run the queries concurrently, I get even better performance.

Is there any way to coax simple queries to take the route I took
using JDBC ?

Thank you,
goffster

Options: ReplyQuote


Subject
Views
Written By
Posted
How might I induce mysql 5.6.x to perform better here
203
January 24, 2018 03:11PM


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.