Ticket #810 (closed enhancement: fixed)
Optimize mysql queries
| Reported by: | jrknierim | Owned by: | omry |
|---|---|---|---|
| Priority: | Normal | Milestone: | 1.6 |
| Component: | FireStats | Version: | 1.5 |
| Severity: | Normal | Keywords: | |
| Cc: |
Description (last modified by omry) (diff)
I work at a shared hosting company, and notice often some (often times large, the example below isn't) queries that are not indexed. I thought I would include some examples and indexes that I've added which have reduced mysql processing. Thank you.
Urls table, there is no index on url.
# Query_time: 0 Lock_time: 0 Rows_sent: 1 Rows_examined: 26419 SELECT id from wp_firestats_urls WHERE url = '<hidden>';
alter table wp_firestats_urls add index url (url (75));
Useragents table, there is no index on useragent.
# Query_time: 0 Lock_time: 0 Rows_sent: 1 Rows_examined: 4307 SELECT id,match_bots from wp_firestats_useragents WHERE useragent = '<hidden>';
alter table wp_firestats_useragents add index useragent (useragent (35));
