Query optimization - Mailing list pgsql-novice

From Eduardo Vázquez Rodríguez
Subject Query optimization
Date
Msg-id 59B41C14544D314889E6FA384A307A9293EB26@osiris.insys-corp.com.mx
Whole thread Raw
List pgsql-novice
Hello Postgres users

I have a question regarding the optimization of a query, I have a table that
contains approximately 14 millions of rows and I want to retrieve the
following information;

SELECT username, sum(bytes_used) AS TOTAL
FROM BIGTABLE
GROUP BY username
LIMIT 100;

Username is an Index varchar
bytes_used is float8 type

But it is really slow, it has been running for 1 hour and it simply does not
ends.

While the query is running, the table is been updating with more rows.

How can I improve it?

Thanks in advanced

pgsql-novice by date:

Previous
From: "Iain"
Date:
Subject: Re: [ADMIN] PostgreSQL Errors...
Next
From: "Dan Quaroni"
Date:
Subject: Copy can't parse a float?