Skip to main content

Timeline for Optimizing a DB Query

Current License: CC BY-SA 4.0

7 events
when toggle format what by license comment
Nov 22, 2020 at 12:31 comment added Wilson Hauck @Akina Thank you for your feedback. I appreciate your participation in SE.
Nov 21, 2020 at 22:05 comment added Akina @WilsonHauck The difference between TIMESTAMP and DATETIME in MySQL is that TIMESTAMP data is adjusted with timezone during save/retrieve whereas for DATETIME the timezone is ignored. But in the storage or during query processing both datatypes are stored/processed as GMT data - so none problems occures. PS. Taking into account the meaning of a column I think that TIMESTAMP datatype was wrong selection...
Nov 21, 2020 at 21:31 comment added Wilson Hauck @Akina Are you aware the datatype of date_awarded is timestamp rather than datetime datatype in the SHOW CREATE TABLE output? Not sure how your WHERE solution can be effective.
Nov 17, 2020 at 18:53 comment added Akina @AsfandyarKhan If so then both tips are relevant. And I do not see the base for third tip (it could be "drop id and use natural PK" but I doubt in such tips)..
Nov 17, 2020 at 18:05 comment added Asfandyar Khan there can be average of 40 rows per subscription_id, we have total of 153,000 subscription_id, and its increasing day by day.
Nov 17, 2020 at 18:02 comment added Asfandyar Khan I have added show create table scheme in questions, kindly check. Date_awarded is always there, its never null
Nov 17, 2020 at 17:57 history answered Akina CC BY-SA 4.0