Re: Creating tons of tables to support a query

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jan Ploski <jpljpl(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Creating tons of tables to support a query
Date: 2002-09-08 23:36:17
Message-ID: 20020909093617.A9934@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-09-08 23:51:55 Re: Creating tons of tables to support a query
Previous Message Jan Ploski 2002-09-08 21:58:44 Creating tons of tables to support a query