MySQL Forums
Forum List  »  InnoDB

Re: Help on Query with DATE BETWEEN not performant
Posted by: Peter Brawley
Date: February 02, 2020 10:30PM

What MySQL version, how much ram, what is innodb_buffer_pool_size?

Explain result doesn't look right for millions of rows.

Before MySQL 8.0, more so before 5.7, a simple join will be faster than IN(...) ...

SELECT DISTINCT A.ID  
from earticles as A
JOIN econtracts_articles AS CA ON A.ID=CA.fk_earticle 
JOIN ecust_user_contract as u ON CA.fk_econtract=u.fk_contract 
                              AND u.fk_cust_user='mihaluka'
WHERE A.dateOfArticle BETWEEN '2019.01.02' AND '2020.02.02';

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Help on Query with DATE BETWEEN not performant
17
February 02, 2020 10:30PM


Sorry, only registered users may post in this forum.

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.