Re: Improve choose_custom_plan for initial partition prune case

2020-10-07 Thread Andy Fan
Thank you Amit and Ashutosh for your reply! On Wed, Oct 7, 2020 at 8:41 PM Amit Langote wrote: > Hi Ashutosh, > > On Wed, Oct 7, 2020 at 8:40 PM Ashutosh Bapat > wrote: > > On Wed, Oct 7, 2020 at 11:20 AM Andy Fan > wrote: > > > On Mon, Oct 5, 2020 at 9:27 PM Ashutosh Bapat < > ashutosh.bapat.

Re: Improve choose_custom_plan for initial partition prune case

2020-10-07 Thread Amit Langote
Hi Ashutosh, On Wed, Oct 7, 2020 at 8:40 PM Ashutosh Bapat wrote: > On Wed, Oct 7, 2020 at 11:20 AM Andy Fan wrote: > > On Mon, Oct 5, 2020 at 9:27 PM Ashutosh Bapat > > wrote: > >> What happens when we > >> execute plans with values that have estimates similar to the generic > >> plan later w

Re: Improve choose_custom_plan for initial partition prune case

2020-10-07 Thread Ashutosh Bapat
On Wed, Oct 7, 2020 at 11:20 AM Andy Fan wrote: > > Hi Ashutosh: > > Thanks for coming. > > On Mon, Oct 5, 2020 at 9:27 PM Ashutosh Bapat > wrote: >> >> On Thu, Oct 1, 2020 at 9:34 PM Andy Fan wrote: >> > >> > Given the plan example: >> > >> > CREATE TABLE measurement ( >> > city_id

Re: Improve choose_custom_plan for initial partition prune case

2020-10-07 Thread Andy Fan
On Wed, Oct 7, 2020 at 2:43 PM Andy Fan wrote: > >> 2. Associate them with RelationOid, and we can record such information in >> the >> Append node as well. The bad part is the same relation Oid may appear >> multiple >> times in a query. for example: SELECT .. FROM p p1, p p2 where >> p1.part

Re: Improve choose_custom_plan for initial partition prune case

2020-10-06 Thread Andy Fan
> > > 2. Associate them with RelationOid, and we can record such information in > the > Append node as well. The bad part is the same relation Oid may appear > multiple > times in a query. for example: SELECT .. FROM p p1, p p2 where > p1.partkey1 = $1 > AND p2.partkey2 = $2; > > I just came up

Re: Improve choose_custom_plan for initial partition prune case

2020-10-06 Thread Andy Fan
On Sat, Oct 3, 2020 at 10:05 AM Andy Fan wrote: > Hi Amit: > > Very glad to see your comment! > > On Fri, Oct 2, 2020 at 4:21 PM Amit Langote > wrote: > >> Hi Andy, >> >> On Fri, Oct 2, 2020 at 1:04 AM Andy Fan wrote: >> > >> > Given the plan example: >> > >> > CREATE TABLE measurement ( >> >

Re: Improve choose_custom_plan for initial partition prune case

2020-10-06 Thread Andy Fan
Hi Ashutosh: Thanks for coming. On Mon, Oct 5, 2020 at 9:27 PM Ashutosh Bapat wrote: > On Thu, Oct 1, 2020 at 9:34 PM Andy Fan wrote: > > > > Given the plan example: > > > > CREATE TABLE measurement ( > > city_id int not null, > > logdate date not null, > > peaktemp

Re: Improve choose_custom_plan for initial partition prune case

2020-10-05 Thread Ashutosh Bapat
On Thu, Oct 1, 2020 at 9:34 PM Andy Fan wrote: > > Given the plan example: > > CREATE TABLE measurement ( > city_id int not null, > logdate date not null, > peaktempint, > unitsales int > ) PARTITION BY RANGE (logdate); > > CREATE TABLE measurement_y20

Re: Improve choose_custom_plan for initial partition prune case

2020-10-02 Thread Andy Fan
Hi Amit: Very glad to see your comment! On Fri, Oct 2, 2020 at 4:21 PM Amit Langote wrote: > Hi Andy, > > On Fri, Oct 2, 2020 at 1:04 AM Andy Fan wrote: > > > > Given the plan example: > > > > CREATE TABLE measurement ( > > city_id int not null, > > logdate date not n

Re: Improve choose_custom_plan for initial partition prune case

2020-10-02 Thread Amit Langote
Hi Andy, On Fri, Oct 2, 2020 at 1:04 AM Andy Fan wrote: > > Given the plan example: > > CREATE TABLE measurement ( > city_id int not null, > logdate date not null, > peaktempint, > unitsales int > ) PARTITION BY RANGE (logdate); > > CREATE TABLE measu

Improve choose_custom_plan for initial partition prune case

2020-10-01 Thread Andy Fan
Given the plan example: CREATE TABLE measurement ( city_id int not null, logdate date not null, peaktempint, unitsales int ) PARTITION BY RANGE (logdate); CREATE TABLE measurement_y2006m02 PARTITION OF measurement FOR VALUES FROM ('2006-02-01') TO