On Mon, 10 Nov 2003, Marc G. Fournier wrote:
>
> explain analyze SELECT ts.company_id, company_name, SUM(ts.bytes) AS total_traffic
> FROM company c, traffic_logs ts
> WHERE c.company_id = ts.company_id
> AND month_trunc(ts.runtime) = '2003-10-01'
> GROUP BY company_name,ts.company_id;
What if you do
ts.runtime >= '2003-10-01' AND ts.runtime < '2003-11-01'
and add an index like (runtime, company_name, company_id)?
--
/Dennis