Re: Postgres seems to use indexes in the wrong order - Mailing list pgsql-general

From Sameer Kumar
Subject Re: Postgres seems to use indexes in the wrong order
Date
Msg-id CADp-Sm4U8pZ=ybcE_4NxjuLzUmT9oVsCqZ1fYhpM6ac8=0UoZw@mail.gmail.com
Whole thread Raw
In response to Postgres seems to use indexes in the wrong order  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Postgres seems to use indexes in the wrong order  (Tim Uckun <timuckun@gmail.com>)
Re: Postgres seems to use indexes in the wrong order  (Tim Uckun <timuckun@gmail.com>)
List pgsql-general

On Fri, Jan 23, 2015 at 3:04 PM, Tim Uckun <timuckun@gmail.com> wrote:
Take a look at this explain

http://explain.depesz.com/s/TTRN

​Adding some info on the query and table structure (and indexes) would be helpful here.​
 


The final number of records is very small but PG is starting out with a massive number of records and then filtering most of them out.

I don't want to really force pg to always use the same index because in some cases this strategy would win but I am wondering if there is anything I need to do in order to get the planner to make better decisions.


​What are the values for below parameters-

- random_page_cost
- seq_page_cost
​- effective_cache_size

 
I already did an analyze on the table.



Best Regards,

Sameer Kumar | Database Consultant

ASHNIK PTE. LTD.

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533

M: +65 8110 0350  T: +65 6438 3504 | www.ashnik.com

icons

 

Email patch

 

This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s).

Attachment

pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: [SQL] commit inside a function failing
Next
From: Leon Dang
Date:
Subject: Request for review of new redis-fdw module