From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marten Feldtmann <marten@feki.toppoint.de>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] index usage ... strange !?
Date: Mon, 17 Jan 2000 17:26:57 -0500
Message-ID: <22018.948148017@sss.pgh.pa.us> (raw)
In-Reply-To: <200001171929.UAA04218@feki.toppoint.de>
References: <200001171929.UAA04218@feki.toppoint.de>
Marten Feldtmann <marten@feki.toppoint.de> writes:
> SELECT AO,AT,AV FROM P3AT
> WHERE EXISTS( SELECT AO FROM P3AT WHERE AV='12' AND AT=12 AND CI=17)
Um ... I dunno what you are trying to accomplish, but this query
almost certainly doesn't do what you want. Since the inner query
is independent of the outer, you will get back either all the rows
of P3AT (if the inner query yields rows) or none (if it doesn't).
The plan you quote is perfectly reasonable for this query...
the machine is even bright enough to figure out that it only
needs to evaluate the subquery once.
regards, tom lane
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-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, marten@feki.toppoint.de
Subject: Re: [SQL] index usage ... strange !?
In-Reply-To: <22018.948148017@sss.pgh.pa.us>
References: <200001171929.UAA04218@feki.toppoint.de> <22018.948148017@sss.pgh.pa.us>
* 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