Daniel-KM / Omeka-plugin-Stats

Plugin for Omeka that counts views of pages in order to know the least popular record and the most viewed pages. It provides useful infos on visitors too (language, referrer...). So this is an analytics tool like Piwik, Google Analytics and other hundreds of such web loggers, but integrated and adapted.
10 stars 2 forks source link

Optimize count queries on summary page #10

Closed jajm closed 5 years ago

jajm commented 5 years ago

On summary page, _statsPeriod is called 11 times and executes 3 SQL queries per call. Those queries are slow with a huge number of entries in hits table. The same result can be achieved with 1 query per call.

Times I get with 2.8M rows in hits table: Without patch: ~48s With patch: ~18s

Daniel-KM commented 5 years ago

Thanks.