php - Query optimization for using both group by and order by -
php - Query optimization for using both group by and order by -
i working on mysql querying table keeps on increasing every minute. query beingness used pagination having limit clause. table consist of user session beingness visited on store website. have added indexes store_id, session_id next query.
select *, group_concat(email) email_id ( select * clickstream clickstream.store_id = '' order id desc ) clck grouping session_id order server_now desc limit ".$offset.",".per_page_product_count any ideas?
your index on store_id help in query, can't speed query farther other indices. can remove subquery:
select *, group_concat(email order id) email_id clickstream clickstream.store_id = '' grouping session_id order server_now desc limit $offset,per_page_product_count php mysql query-optimization
Comments
Post a Comment