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.19980321123108.007f14f0@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
List pgsql-hackers
At 09:54 AM 3/21/98 -0500, Bruce Momjian wrote:

>Try it without the LIKE, with just an equals.

amusements=> explain select name from games where name in (select name from
game
s where mfr = '');
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

--

amusements=> explain select name from games where name in (select name from
game
s2 where mfr = '');
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

The first query approved to be lengthy, but the last query was executed and
returned rows in just a few.

I then did an explain on a query that refered to the games table within the
sub query.

amusements=> explain select name from games where name in (select name from
game
s where mfr = '');
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


For the nature of the searches that the front end send to postgres (the
database is used with a web interface), it is nec. to use the like
expression.  Where should I go from here?

Thanks once again,

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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] 6.3p1 CHANGES
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Newest Patch...try this one...