Tell me more ×  I have query like this! which has 200 million
Records in a single table.. I am using BTree Indexes in my
table...  mysql> select COUNT(DISTINCT id) from [tablename]
where [columname] >=3; | 8242063 1 row in set (3 min 23.53 sec)
I am not satisfy with this timing ..! how can I reduce the
result time less than 30sec. Kindly give me any suggessions! It
will be more helpful to me!  thanking you!  share|improve this
question You could use the explain keyword in front of your
statement, you'll get a bit of information of what the query
executes –  Vengarioth Mar 11 at 6:09 is the id unique across
the table? Why do you do 'COUNT(DISTINCT(id))' instead of
'COUNT(*)'? –  newtover Mar 11 at 6:52 I also tried Explain
keyword.. which give only table rows count.. –  Zameer Ahmed Mar
11 at 6:56 @newtover no, id is not unique in my table.. bcz of
tat I m using distinct id –  Zameer Ahmed Mar 11 at 7:15 Can you
add the output of SHOW CREATE TABLE tablename; ? –  ypercube Jun
29 at 8:53 show 1 more comment  m