Re: Parallel append plan instability/randomness

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Parallel append plan instability/randomness
Date: 2018-01-08 19:50:27
Message-ID: 14123.1515441027@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> In the regression test case at hand, the startup costs are all zero so
> this change wouldn't improve the test case's stability. So I'm thinking
> that in addition, it would be a good idea for these functions to break
> exact compare_path_costs ties in some arbitrary but deterministic way,
> rather than letting qsort() have the final say on what happens. If the
> subplans were all simple relation scans we could order them by planner
> relid, but I'm not sure what to do if they're not.

Ah, I have an idea --- let's create a bms_compare() qsort comparator for
bitmapsets, and use that on the paths' relid sets. It hardly matters
what the exact semantics of the comparator are, as long as it behaves
sanely for equal sets.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-01-08 20:05:25 Re: Parallel append plan instability/randomness
Previous Message Jesper Pedersen 2018-01-08 19:50:02 Re: [HACKERS] Proposal: Local indexes for partitioned table