Re: get_actual_variable_range vs idx_scan/idx_tup_fetch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
Date
Msg-id 10389.1413583153@sss.pgh.pa.us
Whole thread Raw
In response to Re: get_actual_variable_range vs idx_scan/idx_tup_fetch  (Marko Tiikkaja <marko@joh.to>)
Responses Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
List pgsql-hackers
Marko Tiikkaja <marko@joh.to> writes:
> On 10/17/14, 11:47 PM, Tom Lane wrote:
>> Marko Tiikkaja <marko@joh.to> writes:
>>> So what I'd like to have is a way to be able to distinguish between
>>> indexes being used to answer queries, and ones being only used for stats
>>> lookups during planning.

>> Why?  Used is used.

> Because I don't need a 30GB index on foo(a,b,c) to look up statistics. 
> If I ever have a problem, I can replace it with a 5GB one on foo(a).

Well, the index might've been getting used in queries too in a way that
really only involved the first column.  I think you're solving the wrong
problem here.  The right problem is how to identify indexes that are
being used in a way that doesn't exploit all the columns.  Which is not
necessarily wrong in itself --- what you'd want is to figure out when the
last column(s) are *never* used.  The existing stats aren't terribly
helpful for that, I agree.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
Next
From: Jim Nasby
Date:
Subject: Re: get_actual_variable_range vs idx_scan/idx_tup_fetch