Re: UNION ALL has higher cost than inheritance - Mailing list pgsql-hackers

From Tom Lane
Subject Re: UNION ALL has higher cost than inheritance
Date
Msg-id 13453.1287638285@sss.pgh.pa.us
Whole thread Raw
In response to UNION ALL has higher cost than inheritance  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Responses Re: UNION ALL has higher cost than inheritance
List pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@gmail.com> writes:
> I found an explicit UNION ALL has higher cost than an automatic expansion
> by inheritance (49 vs. 83 in the example below). Where does the difference
> come from?

The plan for UNION initially involves a couple of SubqueryScan nodes,
which impose an extra cost of cpu_tuple_cost per tuple.  Those later
get optimized away, but we don't try to readjust the cost estimates
for that.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Extensions, this time with a patch
Next
From: Jeff Davis
Date:
Subject: Re: Serializable snapshot isolation patch