Re: [SQL] index usage ... strange !?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marten Feldtmann <marten(at)feki(dot)toppoint(dot)de>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] index usage ... strange !?
Date: 2000-01-17 22:26:57
Message-ID: 22018.948148017@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Marten Feldtmann <marten(at)feki(dot)toppoint(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael McCarthy 2000-01-18 04:14:36 ordering operator for bytea
Previous Message Marten Feldtmann 2000-01-17 19:29:34 index usage ... strange !?