Re: [HACKERS] nested loops in joins, ambiguous rewrite rules - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] nested loops in joins, ambiguous rewrite rules
Date
Msg-id 199901310312.WAA06973@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] nested loops in joins, ambiguous rewrite rules  (Charles Hornberger <charlie@k4azl.net>)
Responses Re: [HACKERS] nested loops in joins, ambiguous rewrite rules  (Charles Hornberger <charlie@k4azl.net>)
List pgsql-hackers
See the SET options of psql.

test=> show geqo\g
NOTICE:  GEQO is ON beginning with 8 relations
SHOW VARIABLE
test=> \q

We turn on geqo at 8 relations.  Try:
SET GEQO TO 4

and try the query again.  Let us know.


> At 04:07 PM 1/30/99 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >First, you're assuming that a merge-join plan is necessarily better than
> >a nested-loop plan.  That should be true for large queries, but it is
> >*not* necessarily true for small tables --- when there are only a few
> >tuples in the tables being scanned, a simple nested loop wins because it
> >has much less startup overhead.  (Or at least that's what our optimizer
> >thinks; I have not tried to measure this for myself.)
> 
> OK, I understand that I don't understand whether merge-join plans are
> necessarily better than nested-loop plans, and that it could make sense to
> pick one or the other depending on the size of the tables and the number of
> rows in them.  Also, your explanation of how 'vacuum analyze' updates the
> statistics in pg_class and pg_statistic makes it very clear why I'm seeing
> one query plan in one DB, and different plan in the other.  Thanks for the
> quick lesson, and my apologies for making it happen on the hackers list.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: vacuumdb?
Next
From: "D'Arcy" "J.M." Cain
Date:
Subject: Patches