Re: Query plan and sub-queries - Mailing list pgsql-general

From Steve Heaven
Subject Re: Query plan and sub-queries
Date
Msg-id 3.0.1.32.20000808134734.00700ed4@mail.thornet.co.uk
Whole thread Raw
In response to Re: Query plan and sub-queries  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
At 08:24 08/08/00 -0400, you wrote:
> A workaround is to replace IN with EXISTS:

This still does a sequential rather that indexed scan:

explain select * from books_fti where exists
      (select R1684.stockno from R1684,books_fti where
R1684.stockno=books_fti.stockno );

Result  (cost=79300.27 rows=0 width=0)
  InitPlan
    ->  Nested Loop  (cost=2093.00 rows=1024706 width=24)
      ->  Seq Scan on r1684  (cost=43.00 rows=1000 width=12)
      ->  Index Scan using allbooks_isbn on books_fti  (cost=2.05
rows=1024705 width=12)
  ->  Seq Scan on books_fti  (cost=79300.27 rows=1024705 width=160)

--
thorNET  - Internet Consultancy, Services & Training
Phone: 01454 854413
Fax:   01454 854412
http://www.thornet.co.uk

pgsql-general by date:

Previous
From: Philip Warner
Date:
Subject: RE: pg_dump help
Next
From: "Robert D. Nelson"
Date:
Subject: RE: pg_dump help