Re: Forcing index usage

2019-04-24 Thread Jeff Janes
On Wed, Apr 3, 2019 at 12:13 PM Jonathan Marks wrote: Is there a way to tell Postgres “please don’t use index X when queries that > could use index Y instead occur?” > Late to the party here, but... Not directly. I've had luck in changing the procost of functions (or the functions which back t

Re: Forcing index usage

2019-04-17 Thread Bruce Momjian
On Wed, Apr 17, 2019 at 11:16:28AM -0600, Michael Lewis wrote: > > * Michael Lewis (mle...@entrata.com) wrote: > > > Thanks for that advance warning since it is a handy option to force > the > > > planning barrier in my experience. What's a resource to see other > coming > > >

Re: Forcing index usage

2019-04-17 Thread Michael Lewis
> > > * Michael Lewis (mle...@entrata.com) wrote: > > > Thanks for that advance warning since it is a handy option to force the > > > planning barrier in my experience. What's a resource to see other > coming > > > changes in v12 especially changes to default behavior like this? Will > there > > >

Re: Forcing index usage

2019-04-17 Thread Bruce Momjian
On Wed, Apr 3, 2019 at 03:28:48PM -0400, Stephen Frost wrote: > Greetings, > > * Michael Lewis (mle...@entrata.com) wrote: > > Thanks for that advance warning since it is a handy option to force the > > planning barrier in my experience. What's a resource to see other coming > > changes in v12 es

Re: Forcing index usage

2019-04-03 Thread Stephen Frost
Greetings, * Michael Lewis (mle...@entrata.com) wrote: > Thanks for that advance warning since it is a handy option to force the > planning barrier in my experience. What's a resource to see other coming > changes in v12 especially changes to default behavior like this? Will there > be a new cte_c

Re: Forcing index usage

2019-04-03 Thread Michael Lewis
Thanks for that advance warning since it is a handy option to force the planning barrier in my experience. What's a resource to see other coming changes in v12 especially changes to default behavior like this? Will there be a new cte_collapse_limit setting or similar?

Re: Forcing index usage

2019-04-03 Thread Stephen Frost
Greetings, * Michael Lewis (mle...@entrata.com) wrote: > > Is there a way to tell Postgres “please don’t use index X when queries > > that could use index Y instead occur?” > > No. But you could re-write the query to make the date index useless. The > simplest way that comes to mind is putting th

Re: Forcing index usage

2019-04-03 Thread Michael Lewis
> > Is there a way to tell Postgres “please don’t use index X when queries > that could use index Y instead occur?” > No. But you could re-write the query to make the date index useless. The simplest way that comes to mind is putting the query that does your full-text search in a CTE (WITH keyword

Forcing index usage

2019-04-03 Thread Jonathan Marks
Hi folks — We’ve got several tables that are relatively large (~250-500GB in total size) that use very large (tens to hundreds of GB) GIN indexes for full-text search. We’ve set the column statistics for our tsvector columns as high as they go (10,000). We almost always order our search results