Very slow query for the console
Posted: Wed Sep 01, 2004 12:10 pm
Hello!
I have a system consisting of 13 cameras. The query that runs to create the console view is bogging down the system (since this refreshes every now and then). It takes around 40-60 seconds to run each time.
My system specs are as follows:
Pentium 2.8 Ghz
1 GB RAM
400GB storage (stripe raid) with reiserfs filesystem.
Gentoo Linux.
250.000 events currently stored consisting of 16.316.526 frames.
This is the query that runs:
During the query the mysqld process can get up to 85% CPU.
Anybody else experiencing this?
I have a system consisting of 13 cameras. The query that runs to create the console view is bogging down the system (since this refreshes every now and then). It takes around 40-60 seconds to run each time.
My system specs are as follows:
Pentium 2.8 Ghz
1 GB RAM
400GB storage (stripe raid) with reiserfs filesystem.
Gentoo Linux.
250.000 events currently stored consisting of 16.316.526 frames.
This is the query that runs:
Code: Select all
select M.*, count(if(E.Archived=0,1,NULL)) as EventCount, count(if(E.Archived,1,NULL)) as ArchEventCount, count(if(E.StartTime>'2004-09-01 12:09:00' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'2004-09-01 12:09:00' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount, count(if(E.StartTime>'2004-09-01 12:09:00' - INTERVAL 7 DAY && E.Archived = 0,1,NULL)) as WeekEventCount, count(if(E.StartTime>'2004-09-01 12:09:00' - INTERVAL 1 MONTH && E.Archived = 0,1,NULL)) as MonthEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id
Anybody else experiencing this?