Re: Creating tons of tables to support a query - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Creating tons of tables to support a query
Date
Msg-id 20020909010206.GA28109@wolff.to
Whole thread Raw
In response to Re: Creating tons of tables to support a query  (Jan Ploski <jpljpl@gmx.de>)
List pgsql-general
On Mon, Sep 09, 2002 at 01:54:08 +0200,
  Jan Ploski <jpljpl@gmx.de> wrote:
>
> The dateSent is not same for each section, though it may be same
> for several sections (in my app, sections belong to forums, and dateSent
> is same for all sections of the same forum). Anyway, I would like to avoid
> counting by traversing a huge number of rows, and I think it's what the
> backend does behind the scenes for such a query.

Well it sounds like group by won't by you all that much.
However, counts aren't saved anywhere so you are going to need to
look at each row that satisfies the condition of the query.

You might want to double check that the time of the two timestamps
(the one in the table and the constant used for a particular query)
are the same type. If not you may need a cast to get postgres to use
the index.

pgsql-general by date:

Previous
From: "Nathan Hopper"
Date:
Subject: Using the right tool
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Australian Open Source Awards