Mastering Development

Will adding an index to a column improve the select query (without where) performance in SQL?

I have a MySQL table that contains 20 000 000 rows, and columns like (user_id, registered_timestamp, etc). I have written a below query to get a count of users registered day wise. The query was taking a long time to execute. Will adding an index to the registered_timestamp column improve the execution time?

select date(registered_timestamp), count(userid) from table group by 1

Leave a Reply

Your email address will not be published. Required fields are marked *