Re: [HACKERS] nested loops in joins, ambiguous rewrite rules
От | Bruce Momjian |
---|---|
Тема | Re: [HACKERS] nested loops in joins, ambiguous rewrite rules |
Дата | |
Msg-id | 199901310312.WAA06973@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] nested loops in joins, ambiguous rewrite rules (Charles Hornberger <charlie@k4azl.net>) |
Ответы |
Re: [HACKERS] nested loops in joins, ambiguous rewrite rules
|
Список | 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 по дате отправления: