Re: Query only slow on first run

From: "Dave Dutcher" <dave(at)tridecap(dot)com>
To: "'tmp'" <skrald(at)amossen(dot)dk>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Query only slow on first run
Date: 2007-11-28 16:00:05
Message-ID: 05e801c831d7$bea1bee0$8e00a8c0@tridecap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> -----Original Message-----
> From: tmp
> We have primarily two tables of interest here: questions
> (~100k rows) and posts (~400k rows). Each post refers to a
> question, but only the "posts" rows for which the
> corresponding "question.status = 1" are relevant. This
> reduces the number of relevant question rows to about 10k.

Earlier you said only a small subset of questions have a status of 1, so I
assumed you meant like 100 not 10k :) According to the explain analyze
there are only 646 rows in posts which match your criteria, so it does seem
like scanning posts first might be the right thing to do.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Matthew 2007-11-28 16:08:51 Re: GiST indexing tuples
Previous Message Tom Lane 2007-11-28 15:34:52 Re: GiST indexing tuples