ANTI-JOIN needs table, index scan not possible?

From: "hans wulf" <lotu1(at)gmx(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: ANTI-JOIN needs table, index scan not possible?
Date: 2011-03-11 15:32:05
Message-ID: 20110311153205.6380@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

I need an ANTI-JOIN (not exists SELECT something from table.../ left join table WHERE table.id IS NULL) on the same table. Acutally I have an index to serve the not exists question, but the query planner chooses to to a bitmap heap scan.

The table has 100 Mio rows, so doing a heap scan is messed up...

It would be really fast if Postgres could compare the to indicies. Does Postgres have to visit the table for this ANTI-JOIN?

I know the table has to be visitied at some point to serve the MVCC, but why so early? Can NOT ESISTS only be fixed by the table, because it could miss soemthing otherwise?

--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message fork 2011-03-11 16:46:28 Re: big joins not converging
Previous Message Robert Haas 2011-03-11 04:36:27 Re: NULLS LAST performance