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

From Martijn van Oosterhout
Subject Re: Creating tons of tables to support a query
Date
Msg-id 20020909093617.A9934@svana.org
Whole thread Raw
In response to Creating tons of tables to support a query  (Jan Ploski <jpljpl@gmx.de>)
List pgsql-general
On Sun, Sep 08, 2002 at 11:58:44PM +0200, Jan Ploski wrote:
> Hello,
>
> I am in particular wondering, why an index on message(sectionID, dateSent)
> does not make these queries comparably fast:
>
>     select msgnum from message where
>         sectionID = ? and
>         dateSent > ?
>         order by dateSent
>         limit 1;
>
>     select msgnum from scnt_9 where
>         dateSent > ?
>         order by dateSent
>         limit 1;
>
> (scnt_9 is a lookup table which only creates msgnums for messages
> with sectionID == 9)
>

Can you send the results of EXPLAIN ANALYZE for both those queries. Thanks.

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

pgsql-general by date:

Previous
From: Jan Ploski
Date:
Subject: Creating tons of tables to support a query
Next
From: Bruno Wolff III
Date:
Subject: Re: Creating tons of tables to support a query