pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew - Supernews <andrew+nonews@supernews.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #1552: massive performance hit between 7.4 and 8.0.1
Date: Thu, 24 Mar 2005 09:14:25 -0000
Message-ID: <slrnd4517h.rhd.andrew+nonews@trinity.supernews.net> (raw)
References: <20050318232102.08FA0F0E5D@svr2.postgresql.org>
	<1111567230.11750.596.camel@localhost.localdomain>
	<4241C1DF.2020000@deepsky.com>
	<slrnd43hta.rhd.andrew+nonews@trinity.supernews.net>
	<13841.1111608763@sss.pgh.pa.us>
	<4241D7AB.4030607@deepsky.com>
	<14846.1111616020@sss.pgh.pa.us>

On 2005-03-23, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> No, it wouldn't, because by the time you do the first FK trigger you'd
> have one row/one page in the referenced table, so it'd still look like a
> seqscan situation to the planner.  The only way we could make that work
> is to effectively disable seqscans entirely, by *always* pretending the
> table size is large enough to trigger an indexscan, even when the
> planner can plainly see that it's not.  This is not an acceptable answer
> IMHO.

I'm not yet convinced the planner is right to _ever_ choose a seqscan for
FK triggers. The idea that a seqscan is faster on small tables is
traditional, and it has some justification in the case where nothing is
in the cache (since index scan will touch the disk twice in that case),
but I'm finding that for tables of the order of 50 rows (easily fitting in
one page) that index scans are as fast as or faster than seqscans for
doing simple one-row lookups provided the tables are in cache.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services



view thread (14+ messages)  latest in thread

Message-ID: <slrnd4517h.rhd.andrew+nonews@trinity.supernews.net>
Permalink:  ../slrnd4517h.rhd.andrew+nonews@trinity.supernews.net/
Also on:    postgresql.org/message-id/slrnd4517h.rhd.andrew+nonews@trinity.supernews.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: andrew+nonews@supernews.com, pgsql-bugs@postgresql.org
  Subject: Re: BUG #1552: massive performance hit between 7.4 and 8.0.1
  In-Reply-To: <slrnd4517h.rhd.andrew+nonews@trinity.supernews.net>
  References: <20050318232102.08FA0F0E5D@svr2.postgresql.org> <1111567230.11750.596.camel@localhost.localdomain> <4241C1DF.2020000@deepsky.com> <slrnd43hta.rhd.andrew+nonews@trinity.supernews.net> <13841.1111608763@sss.pgh.pa.us> <4241D7AB.4030607@deepsky.com> <14846.1111616020@sss.pgh.pa.us> <slrnd4517h.rhd.andrew+nonews@trinity.supernews.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox