Re: Using indices for UNION.

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, peter_e(at)gmx(dot)net
Subject: Re: Using indices for UNION.
Date: 2013-11-19 11:41:58
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello, I've totally refactored the series of pathes and cut out
the appropriate portion as 'UNION stuff'.

This patch rquires another 'pathkeys expansion using fully-orderd
index' patch to work.

1. plan_with_pathkeys_v1_20131119.patch

This is a patch adding pathkeys (and uniqueness) information on
struct Plan to do what the latter part of grouping_planner does
on current_pathkeys in seemingly autonomous way. As in the
previous discussion, this is in a sense a bad direction to
go. But this patch make the path manipulations occured in the
latter of grouping_planner simple and would reduce extra sorting
and uniq'ing.

2. union_uses_idx_v3_20131119.patch

This is made to apply after the first patch above. The core of
"Using indices for UNION". This is - as in the previous
discussion - also not in so smart way to do that. Most of all,
this patch runs subquery_planner additionally for UNION with
some conditions. Nevertheless, the expected gain should not be


Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
plan_with_pathkeys_v1_20131119.patch text/x-patch 17.9 KB
union_uses_idx_v3_20131119.patch text/x-patch 26.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-11-19 12:03:11 Re: Windows build patch
Previous Message Kyotaro HORIGUCHI 2013-11-19 11:35:16 Re: Get more from indices.