Skip to main content

Timeline for Optimizing a DB Query

Current License: CC BY-SA 4.0

8 events
when toggle format what by license comment
Nov 28, 2020 at 15:51 comment added Wilson Hauck If any of the comments or Answers helped you, please upvote or Accept so we know you are making progress, please and Thank You.
Nov 21, 2020 at 13:53 comment added Wilson Hauck Do you have flexibility (data space availability) to A) USE (yourDB); and ALTER TABLE user_rewards ADD INDEX user_rewards_ndx_date_awarded (date_awarded); ? If you do, B) Are you aware that in 2038, due to range limits, datatype of timestamp will begin failing sometime in January of 2038? Use of datetime time datatype would avoid the problem. If you can ADD INDEX for either datatype, I will prepare a query that will avoid current tablescan for you.
Nov 17, 2020 at 17:59 history edited Asfandyar Khan CC BY-SA 4.0
Schema updated
Nov 17, 2020 at 17:57 answer added Akina timeline score: 1
Nov 17, 2020 at 17:52 comment added Akina Provide complete SHOW CREATE TABLE user_rewards; output, table statistic(total rows amount, approximate distinct subscription_id per output and average rows per month per subscription_id. Also - does date_awarded <= CURRENT_DATE is true for ALL rows?
Nov 17, 2020 at 17:50 history edited Akina CC BY-SA 4.0
added 14 characters in body
Nov 17, 2020 at 17:41 review First posts
Nov 17, 2020 at 19:26
Nov 17, 2020 at 17:37 history asked Asfandyar Khan CC BY-SA 4.0