Re: index scan forward vs backward = speed difference of 357X slower! - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: index scan forward vs backward = speed difference of 357X slower!
Date
Msg-id 4F32B3B20200002500045085@gw.wicourts.gov
Whole thread Raw
In response to Re: index scan forward vs backward = speed difference of 357X slower!  (Kevin Traster <ktraster@freshgrillfoods.com>)
List pgsql-performance
Kevin Traster <ktraster@freshgrillfoods.com> wrote:

> I have indexes also on activity and mfiled (both btree) - wouldn't
> the database use them? - Kevin

It will use them if they are part of the plan which had the lowest
cost when it compared the costs of all possible plans.

You haven't really shown us the schema, so there's more guesswork
involved in trying to help you than there could be.  This page might
be worth reviewing:

http://wiki.postgresql.org/wiki/SlowQueryQuestions

In particular, if there are indexes that aren't being used which you
think should be, there is a good chance that either there is a type
mismatch or your costing factors may need adjustment.

-Kevin

pgsql-performance by date:

Previous
From: Kevin Traster
Date:
Subject: Re: index scan forward vs backward = speed difference of 357X slower!
Next
From: Josh Berkus
Date:
Subject: Re: random_page_cost = 2.0 on Heroku Postgres