Re: WHY : select count(*) not returning any results?
Posted by:
Rick James
Date: February 21, 2014 06:21PM
The SELECT is reading all 20997619712 bytes. InnoDB must do a scan to honor the transactional semantics.
Still, 10 hours seems long for reading 20GB. Are your disks expecially slow? Are other queries interacting a lot with the table?
creation_date is DATETIME, which takes 8 bytes; TIMESTAMP would take only 4 bytes. That change would shrink the index significantly. (Still the COUNT(*) would take a long time.)
How exact do you need the COUNT(*) to be? Note that SHOW TABLE STATUS was quite fast, and gave you an _estimate_ of 674576234 Rows.
Subject
Views
Written By
Posted
2279
February 19, 2014 01:00PM
Re: WHY : select count(*) not returning any results?
1572
February 21, 2014 06:21PM
882
March 12, 2014 12:34AM
1038
March 12, 2014 01:06PM
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.