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

Re: Query only slow on first run

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cluster <skrald(at)amossen(dot)dk>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query only slow on first run
Date: 2007-11-29 15:32:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
cluster <skrald(at)amossen(dot)dk> writes:
>> You're essentially asking for a random sample of data that is not
>> currently in memory.  You're not going to get that without some I/O.

> No, that sounds reasonable enough. But do you agree with the statement 
> that my query will just get slower and slower over time as the number of 
> posts increases while the part having status = 1 is constant?

No, not as long as it sticks to that plan.  The time's basically
determined by the number of aggregate rows the LIMIT asks for,
times the average number of "post" rows per aggregate group.
And as far as you said the latter number is not going to increase.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2007-11-29 15:45:31
Subject: Re: TB-sized databases
Previous:From: Brad NicholsonDate: 2007-11-29 15:10:54
Subject: 7.4 Checkpoint Question

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