From: Victor Yegorov <viy@nordlb.lv>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Rudi Starcevic <rudi@oasis.net.au>
Cc: Postgres Performance <pgsql-performance@postgresql.org>
Subject: Re: constraint with reference to the same table
Date: Thu, 15 May 2003 04:03:41 +0300
Message-ID: <20030515010341.GD1549@nordlb.lv> (raw)
In-Reply-To: <20030514174656.B52132-100000@megazone23.bigpanda.com>
References: <20030515001239.GC1549@nordlb.lv>
<20030514174656.B52132-100000@megazone23.bigpanda.com>
* Stephan Szabo <sszabo@megazone23.bigpanda.com> [15.05.2003 03:54]:
>
> That can be a win, but if you're actually dropping and adding the
> constraint again it may not be on large tables since it'll still do a
> whole bunch of index lookups to check the existing rows when the alter
> table add constraint happens. Disabling triggers and re-enabling them is
> faster but breaks the guarantee of the constraint.
You're right. I thought of big tables after posting the reply. My solution
is suitable for my case, i.e. not so big tables.
Returning to the very first question I asked.
May be it is usefull to implicitly create index on foreign key columns?
Actually, untill you had pointed on seq. scans, I thought Postgres is
using internal indicies - don't ask me why.
--
Victor Yegorov
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: viy@nordlb.lv, sszabo@megazone23.bigpanda.com, rudi@oasis.net.au
Subject: Re: constraint with reference to the same table
In-Reply-To: <20030515010341.GD1549@nordlb.lv>
References: <20030515001239.GC1549@nordlb.lv> <20030514174656.B52132-100000@megazone23.bigpanda.com> <20030515010341.GD1549@nordlb.lv>
* 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