[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

readlocals SQL query



Hello,

I noticed in the postgresql log that a CPU consuming query is ran
quite often.

SELECT DISTINCT virtual_host FROM passwd WHERE enabled='1' AND (startdate IS NULL OR startdate<=CURRENT_TIMESTAMP) AND (stopdate IS NULL OR stopdate>=CURRENT_TIMESTAMP);

We host around 5000 domains and running this query that often slows
the server quite a lot.

Can somebody explain why this query is needed ?
How can it be optimized ?

Thank you,

-- 
Catalin Constantin
Bounce Software
http://www.bounce-software.com
http://www.cabanova.ro