Re: Why does the query planner use two full indexes, when a dedicated partial index exists?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Richard Neill <rn214(at)richardneill(dot)org>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Why does the query planner use two full indexes, when a dedicated partial index exists?
Date: 2012-12-21 05:15:17
Message-ID: CAMkU=1zTU9RtyEAsAAfC5i0r6c-c=i-tVOPfF8J=Q-FgDQ31Qw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thursday, December 20, 2012, Richard Neill wrote:

>
>
>
> - What I'm trying to do is trace the history of the books
> through the system and assign each one a proper unique id.
> So, if I see a book with "parcel_id_code = 37",
> is it a new book (after pid wrap), or is it the same book I saw 1
> minute ago, that hasn't exited the sorter?
>

I'm not sure how you are implementing this goal, but I don't think it is
best done by looping over all books (presumably from some other table?) and
issuing an individual query for each one, if that is what you are doing.
Some kind of bulk join would probably be more efficient.

Cheers,

Jeff

>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Gurjeet Singh 2012-12-21 06:16:12 Re: [PERFORM] pgbench to the MAXINT
Previous Message Jeff Janes 2012-12-21 05:15:16 Re: Why does the query planner use two full indexes, when a dedicated partial index exists?