pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Віталій Тимчишин <tivv00@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: PostgreSQL OR performance
Date: Mon, 17 Nov 2008 11:52:21 +0200
Message-ID: <331e40660811170152v219b5327hc1564da48dde2143@mail.gmail.com> (raw)
In-Reply-To: <7426.1226768851@sss.pgh.pa.us>
References: <331e40660811050312u552cab53ifa88e493e1c4f7ac@mail.gmail.com>
	<331e40660811060246m51df553egd4e2ba91f08d1434@mail.gmail.com>
	<29e3942f0811060426k5fe34b1av401a2dba62e4ae3c@mail.gmail.com>
	<331e40660811060833l49bf837em41ca88d4b2061ea1@mail.gmail.com>
	<49131ED5.80307@archonet.com>
	<331e40660811060937q460e6f9fvf336455200d31f56@mail.gmail.com>
	<331e40660811070114rd70cf0dy194020a9f9ea8802@mail.gmail.com>
	<49141C5E.2010404@archonet.com>
	<331e40660811150557s50e54c54m974645e31e30a612@mail.gmail.com>
	<7426.1226768851@sss.pgh.pa.us>

2008/11/15 Tom Lane <tgl@sss.pgh.pa.us>

> "=?ISO-8859-5?B?svbi0Nv22SDC2Nzn2OjY3Q==?=" <tivv00@gmail.com> writes:
> > I am not. I can't see how materialize can multiply number of rows it gets
> > from sort by 100.
>
> Is it the right-hand input of a merge join?  If so you're looking at
> mark/restore rescans, ie, repeated fetches of the same tuples.  There
> must be a huge number of duplicate join keys in that relation to make
> for such an increase though.  Normally the planner avoids putting a
> table with lots of duplicates as the RHS of a merge, but if it doesn't
> have good statistics for the join key then it might not realize the
> problem.
>

OK, thanks for cleaning-up some mystery.
But, returning to original Q: Do anyone known why does it choose plan from *
OR-plan.txt* instead of *union-plan.txt*? The first is
cost=4588.13..960900482668.95, the latter is cost=266348.42..272953.14
according to statistics postgres have, so I suppose planner would select it
if it could evaluate it.

view thread (16+ messages)

Message-ID: <331e40660811170152v219b5327hc1564da48dde2143@mail.gmail.com>
Permalink:  ../331e40660811170152v219b5327hc1564da48dde2143@mail.gmail.com/
Also on:    postgresql.org/message-id/331e40660811170152v219b5327hc1564da48dde2143@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tivv00@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: PostgreSQL OR performance
  In-Reply-To: <331e40660811170152v219b5327hc1564da48dde2143@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox