[HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Benedikt Grundmann
That is it possible to tell the planner that index is off limits i.e. don't ever generate a plan using it? Rationale: Schema changes on big tables. I might have convinced myself / strong beliefs that for all queries that I need to be fast the planner does not need to use a given index (e.g.

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread David G Johnston
Benedikt Grundmann wrote That is it possible to tell the planner that index is off limits i.e. don't ever generate a plan using it? Rationale: Schema changes on big tables. I might have convinced myself / strong beliefs that for all queries that I need to be fast the planner does not

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Tom Lane
David G Johnston david.g.johns...@gmail.com writes: Benedikt Grundmann wrote That is it possible to tell the planner that index is off limits i.e. don't ever generate a plan using it? Catalog hacking could work but not recommended (nor do I know the proper commands and limitations). Do you

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Andres Freund
On 2014-07-11 11:07:21 -0400, Tom Lane wrote: David G Johnston david.g.johns...@gmail.com writes: Benedikt Grundmann wrote That is it possible to tell the planner that index is off limits i.e. don't ever generate a plan using it? Catalog hacking could work but not recommended (nor do I

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-07-11 11:07:21 -0400, Tom Lane wrote: Hacking pg_index.indisvalid could work, given a reasonably recent PG. I would not try it in production until I'd tested it ;-) Works, but IIRC can cause problems at least 9.4 because concurrent cache

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Andres Freund
On 2014-07-11 11:20:08 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-07-11 11:07:21 -0400, Tom Lane wrote: Hacking pg_index.indisvalid could work, given a reasonably recent PG. I would not try it in production until I'd tested it ;-) Works, but IIRC can

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-07-11 11:20:08 -0400, Tom Lane wrote: If you're talking about SnapshotNow hazards, I think the risk would be minimal, and probably no worse than cases that the system will cause by itself. Yes, SnapshotNow. I could reproduce it causing

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread Michael Banck
On Fri, Jul 11, 2014 at 11:07:21AM -0400, Tom Lane wrote: David G Johnston david.g.johns...@gmail.com writes: Benedikt Grundmann wrote That is it possible to tell the planner that index is off limits i.e. don't ever generate a plan using it? Catalog hacking could work but not

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread David Johnston
On Fri, Jul 11, 2014 at 12:12 PM, Michael Banck mba...@gmx.net wrote: On Fri, Jul 11, 2014 at 11:07:21AM -0400, Tom Lane wrote: David G Johnston david.g.johns...@gmail.com writes: Benedikt Grundmann wrote That is it possible to tell the planner that index is off limits i.e. don't