MySQL Forums
Forum List  »  Newbie

Re: Slowest Queries
Posted by: Peter Brawley
Date: June 27, 2022 08:59AM

WB probably silently adds a scoping Limit clause whereas your PHP script may have tried to retrieve all rows from the query.

To find how to speed up the query, please post MySQL version, amount of RAM, innodb_buffer_pool_size, and the results of ...

show create table `table`;

explain analyze
select count(distinct(Col_A)),ID,NAME
from table
where data between `2022-06-24 00:00:00` and ` 2022-06-24 23:59:59`
group by ID, NAME;

BTW, why not just ...where left(data,10)='2022-06-24'... ?

Options: ReplyQuote


Subject
Written By
Posted
June 27, 2022 06:24AM
Re: Slowest Queries
June 27, 2022 08:59AM


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.