>>>>> "Steven" == Steven Roussey <sroussey@stripped> writes:
>> > select statements that take forever:
>> > SELECT count(*) FROM gas_alarms, gas_alarm_attributes WHERE
>> > gas_alarms.internal_id = gas_alarm_attributes.alarm_id AND
>> state = 'closed'
>> > AND
>> > timestamp >= FROM_UNIXTIME(938010283) AND timestamp <=
>> > FROM_UNIXTIME(938096683);
>> >
>> > Count took 45 seconds
Steven> I have experienced major speed delays when using count(*) in MySQL when the
Steven> MySQL is busy. You might try removing all count(*) statements with a select
Steven> on the smallest field and simply count the results. We found this changed
Steven> our server from almost crippled to very usable.
Hi!
The above shouldn't be true; COUNT(*) without a group by should
always be much faster than counting rows.
Any change you can modify one of the MySQL benchmarks (test-insert?)
to verify the above?
Regards,
Monty