Re: How are foreign key constraints built?

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Wes <wespvp(at)syntegra(dot)com>, Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How are foreign key constraints built?
Date: 2005-01-23 21:59:23
Message-ID: 20050123215923.GB67721@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 23, 2005 at 06:45:36PM -0300, Alvaro Herrera wrote:
> On Sun, Jan 23, 2005 at 03:19:10PM -0600, Jim C. Nasby wrote:
>
> > > People have this weird notion that an index-based plan is always faster
> > > than anything else. If you like you can try the operation with "set
> > > enable_seqscan = off", but I bet it will take longer.
> >
> > Well, every other database I've used can do index covering, which means
> > index scans *are* faster.
>
> ... on those database systems. Indexes are different in Postgres in
> general: they don't have visibility info (other systems don't need it,
> tuples are always visible), and in some databases you have clustered
> indexes, where the index is also the heap.

Yes, I understand. I was just pointing out that in other databases, an
index scan of even the entire table can be faster, hence the mentality
that index scans are always better.

I really hope that the current discussion on hackers about tuple
visibility in indexes leads somewhere; I think that would be a huge gain
for PostgreSQL.
--
Jim C. Nasby, Database Consultant decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-01-23 22:02:43 Re: number of rown in a cursor.
Previous Message Alvaro Herrera 2005-01-23 21:45:36 Re: How are foreign key constraints built?