Re: Critical performance problems on large databases - Mailing list pgsql-general

From Tom Lane
Subject Re: Critical performance problems on large databases
Date
Msg-id 23861.1018479733@sss.pgh.pa.us
Whole thread Raw
In response to Critical performance problems on large databases  (Gunther Schadow <gunther@aurora.regenstrief.org>)
Responses Re: Critical performance problems on large databases
List pgsql-general
Gunther Schadow <gunther@aurora.regenstrief.org> writes:
> We also noted that a
> SELECT COUNT(*) FROM BigQuery;
> can take quite a long time and again use a lot of resources,
> whereas
> SELECT COUNT(smallcolumn) FROM BigQuery;
> may be faster and less resource consuming.

This is complete nonsense... if anything, the second one will take
more cycles, since it has to actually examine a column.

As for the other thing, use a cursor and "fetch" a few rows at a time
if you want to overlap frontend and backend processing.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY Error Message is Confusing
Next
From: Stephan Szabo
Date:
Subject: Re: Critical performance problems on large databases