Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] psql nested queries with 2000+ records

From: Coronach <coronach(at)hill-b-073(dot)resnet(dot)purdue(dot)edu>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] psql nested queries with 2000+ records
Date: 1998-03-20 22:24:50
Message-ID: 3.0.5.32.19980320172450.007e3b30@diety.conclave.org (view raw or flat)
Thread:
Lists: pgsql-hackers
At 12:24 PM 3/20/98 -0500, Bruce Momjian wrote:

>Very strange.  15+ minutes?  Wow, that is terrible, even longer than a
>sequential scan of the table.  Try EXPLAIN and tell us what it says in
>the two cases.

This is within the 2717 record database.

explain select name from games where name in (select name from games where
name like 'A%');

NOTICE:  QUERY PLAN:

Seq Scan on games  (cost=207.95 size=446 width=12)
  SubPlan
    ->  Seq Scan on games  (cost=207.95 size=1 width=12)

NOTICE:  QUERY PLAN:

Seq Scan on games  (cost=207.95 size=446 width=12)
  SubPlan
    ->  Seq Scan on games  (cost=207.95 size=1 width=12)

EXPLAIN

This is within the 24 record database of the same type of data

explain select name from games where name in (select name from game
s where name like 'A%');
NOTICE:  QUERY PLAN:

Seq Scan on games  (cost=207.95 size=446 width=12)
  SubPlan
    ->  Seq Scan on games  (cost=207.95 size=1 width=12)

NOTICE:  QUERY PLAN:

Seq Scan on games  (cost=207.95 size=446 width=12)
  SubPlan
    ->  Seq Scan on games  (cost=207.95 size=1 width=12)

EXPLAIN

Obviously, I get the same information, any suggestions?

-Coronach(at)hill-b-073(dot)resnet(dot)purdue(dot)edu


In response to

Responses

pgsql-hackers by date

Next:From: The Hermit HackerDate: 1998-03-20 23:25:09
Subject: Re: [HACKERS] tonight's mega-patch
Previous:From: Bruce MomjianDate: 1998-03-20 22:14:29
Subject: Re: Added Having Clause

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group