Re: [HACKERS] subselect and optimizer

From: t-ishii(at)sra(dot)co(dot)jp
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: t-ishii(at)sra(dot)co(dot)jp, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] subselect and optimizer
Date: 1998-04-10 10:45:44
Message-ID: 199804101045.TAA00249@srapc451.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>I will say we have an optimization problem with tables being referenced
>multiple times in a query, but I don't know if this is the cause, though
>you could test it by making a copy of order_tbl with another name, and
>testing the speed.

Thank you for your suggestion. I made a copy of order_tbl (named
order_tbl1) and did a query:

explain select * from product,order_tbl where \
product.serial=order_tbl.serial and product.serial in \
(select serial from order_tbl1 where cust_id='H3550');
NOTICE: QUERY PLAN:

Hash Join (cost=934.65 size=798 width=112)
-> Seq Scan on order_tbl (cost=296.82 size=6843 width=36)
-> Hash (cost=0.00 size=0 width=0)
-> Seq Scan on product (cost=383.71 size=797 width=76)
SubPlan
-> Index Scan on order_tbl1 (cost=2.05 size=1 width=12)

Seems like no change here?
--
Tatsuo Ishii
t-ishii(at)sra(dot)co(dot)jp

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter T Mount 1998-04-10 10:45:50 Re: [HACKERS] New pg_type for large object
Previous Message Aleksey Dashevsky 1998-04-10 10:31:02 Agregates in update?