Re: Index scan cost calculation - Mailing list pgsql-performance

From Tom Lane
Subject Re: Index scan cost calculation
Date
Msg-id 6786.1448562387@sss.pgh.pa.us
Whole thread Raw
In response to Re: Index scan cost calculation  (Glyn Astill <glynastill@yahoo.co.uk>)
List pgsql-performance
Glyn Astill <glynastill@yahoo.co.uk> writes:
>> From: Tom Lane <tgl@sss.pgh.pa.us>
>> The problem will probably go away by itself as your table grows, but
>> if you don't want to wait, you might want to reflect on which of the index
>> columns might be (partially?) functionally dependent on the other columns,
>> and whether you could redesign the key structure to avoid that.

> Many thanks for the explanation, is such a functional  dependency assumed purely based optimistically on statistics
gatheredby analyze? 

Well, the point is that the selectivities associated with the individual
WHERE clauses are assumed independent, which allows us to just multiply
them together.  If they're not really independent then multiplication
gives a combined selectivity that's too small.  But without cross-column
statistics there's not much we can do to get a better estimate.

            regards, tom lane


pgsql-performance by date:

Previous
From: Glyn Astill
Date:
Subject: Re: Index scan cost calculation
Next
From: Jeff Janes
Date:
Subject: Re: Index scan cost calculation