Re: [HACKERS] psql nested queries with 2000+ records - Mailing list pgsql-hackers

From Coronach
Subject Re: [HACKERS] psql nested queries with 2000+ records
Date
Msg-id 3.0.5.32.19980321011207.007eb100@diety.conclave.org
Whole thread Raw
In response to Re: [HACKERS] psql nested queries with 2000+ records  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] psql nested queries with 2000+ records  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>select * into games2 from games;

amusements=> select * into games2 from games;
ERROR:  parser: parse error at or near "games2"

But, I just dumped it and changed a few things to fit the scenario...

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

amusements=> explain select name from games where name in (select name from
game
s2 where name like 'A%');
NOTICE:  QUERY PLAN:

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

EXPLAIN

Upon execution of the query, it still took quite a long time.

>causing the problem.  I assume you have run vacuum and vacuum analyze.

Yep, ran vacuum on it and also had it work with newly generated databases too.


Any other suggestions would be welcome, thanks

-Coronach@hill-b-073.resnet.purdue.edu


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: 6.3p1 CHANGES
Next
From: "Luuk de Boer"
Date:
Subject: Re: [HACKERS] Re: [QUESTIONS] MySQL benchmark page