Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

Next:From: MatthewDate: 2007-11-28 16:08:51
Subject: Re: GiST indexing tuples
Previous:From: Tom LaneDate: 2007-11-28 15:34:52
Subject: Re: GiST indexing tuples

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group