Re: Our trial to TPC-DS but optimizer made unreasonable plan - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Our trial to TPC-DS but optimizer made unreasonable plan
Date
Msg-id 20150831163632.GB31526@awork2.anarazel.de
Whole thread Raw
In response to Re: Our trial to TPC-DS but optimizer made unreasonable plan  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On 2015-08-19 15:14:03 -0700, Josh Berkus wrote:
> Asking users to refactor their applications to add OFFSET 0 is a bit
> painful, if we could take care of it via a backwards-compatibility GUC.
>  We have many users who are specifically using the CTE optimization
> barrier to work around planner failures.

Agreed. I think we'll cause a lot of problems in migrations if we do
this unconditionally. I also think CTEs are a much cleaner optimization
barrier than OFFSET 0.

Some are probably going to hate me for this, but I think it'd be better
to change the grammar to something like
name opt_name_list AS '(' PreparableStmt ')' OPTIONS '(' cte_option_list ')'

and allow to specify 'inline' 'off'/'on'. The guc would simply change
the default value.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Qingqing Zhou
Date:
Subject: Re: Our trial to TPC-DS but optimizer made unreasonable plan
Next
From: YUriy Zhuravlev
Date:
Subject: Re: Scaling PostgreSQL at multicore Power8