php - How to optimize this mySQL query in terms of performance? -
how can optimize follow query ?
select hash,page,timestamp, count(*) total behaviour group hash, page having total > 2 , timestamp >= now() - interval 5 minute
thank you
this query it's not wrong. maybe bigger volume, have problem performance. try use "where conditions" always. (in context, don't know if possible). tip, explain on query! use "explain" before query. (explain select hash, timestamp, count(*)........). in way, can discover how many results query returned.
Comments
Post a Comment