Re: [HACKERS] psql nested queries with 2000+ records
| От | Coronach |
|---|---|
| Тема | Re: [HACKERS] psql nested queries with 2000+ records |
| Дата | |
| Msg-id | 3.0.5.32.19980321123108.007f14f0@diety.conclave.org обсуждение исходный текст |
| Ответ на | Re: [HACKERS] psql nested queries with 2000+ records (Bruce Momjian <maillist@candle.pha.pa.us>) |
| Ответы |
Re: [HACKERS] psql nested queries with 2000+ records
|
| Список | 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 по дате отправления: