[PERFORM] Regression from 9.4-9.6

2017-10-08 Thread Jim Nasby
I've got a query that's regressed from 9.4 to 9.6. I suspect it has something to do with the work done around bad plans from single-row estimates. There's a SeqScan happening even though the join is to the PK of bd_ident. Full plans are at [1,2,3], but here's the relevant bits... 9.4: ->

Re: [PERFORM] Regression from 9.4-9.6

2017-10-08 Thread Jim Nasby
On 10/8/17 3:02 PM, Jim Nasby wrote: -> Index Scan using bdata_filed_departuretime on bdata_forks (cost=0.57..50807.51 rows=1 width=36) (actual time=979.381..3207.777 rows=508 loops=1) -> Index Scan using bdata_filed_departuretime on bdata_forks (cost=0.57..14894236.06 rows=1 width=36)

Re: [PERFORM] Regression from 9.4-9.6

2017-10-08 Thread Jim Nasby
On 10/8/17 3:37 PM, Tom Lane wrote: Jim Nasby writes: On 10/8/17 2:34 PM, Tom Lane wrote: Why has this indexscan's cost estimate changed so much? Great question... the only thing that sticks out is the coalesce(). Let me see if an analyze with a higher stats target changes

Re: [PERFORM] Regression from 9.4-9.6

2017-10-08 Thread Tom Lane
Jim Nasby writes: > I've got a query that's regressed from 9.4 to 9.6. I suspect it has > something to do with the work done around bad plans from single-row > estimates. Why has this indexscan's cost estimate changed so much? >> -> Index Scan using bdata_filed_departuretime

Re: [PERFORM] Regression from 9.4-9.6

2017-10-08 Thread Jim Nasby
On 10/8/17 2:34 PM, Tom Lane wrote: Jim Nasby writes: I've got a query that's regressed from 9.4 to 9.6. I suspect it has something to do with the work done around bad plans from single-row estimates. Why has this indexscan's cost estimate changed so much? -> Index Scan

Re: [PERFORM] Regression from 9.4-9.6

2017-10-08 Thread Tom Lane
Jim Nasby writes: > On 10/8/17 2:34 PM, Tom Lane wrote: >> Why has this indexscan's cost estimate changed so much? > Great question... the only thing that sticks out is the coalesce(). Let > me see if an analyze with a higher stats target changes anything. FWIW, > the 9.6