Re: [HACKERS] subselect and optimizer - Mailing list pgsql-hackers

From t-ishii@sra.co.jp
Subject Re: [HACKERS] subselect and optimizer
Date
Msg-id 199804101045.TAA00249@srapc451.sra.co.jp
Whole thread Raw
In response to Re: [HACKERS] subselect and optimizer  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] subselect and optimizer
List 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@sra.co.jp

pgsql-hackers by date:

Previous
From: Aleksey Dashevsky
Date:
Subject: Agregates in update?
Next
From: Peter T Mount
Date:
Subject: Re: [INTERFACES] New pg_type for large object