From: tv@fuzzy.cz
To: anthony.shipman@symstream.com
Cc: tv@fuzzy.cz, pgsql-performance@postgresql.org, "Claudio Freire" <klaussfreire@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Subject: Re: strange query plan with LIMIT
Date: Fri, 10 Jun 2011 13:22:58 +0200
Message-ID: <9f040b694b5b87c5ab1754b37e367e10.squirrel@sq.gransy.com> (raw)
In-Reply-To: <201106101838.39781.anthony.shipman@symstream.com>
References: <201106071802.08272.anthony.shipman@symstream.com>
<201106081834.07263.anthony.shipman@symstream.com>
<c48d12d868ecc4b9ab6063f562650722.squirrel@sq.gransy.com>
<201106101838.39781.anthony.shipman@symstream.com>
> If I had set the primary key to (diag_id, create_time) would simple
> queries on
> diag_id still work well i.e.
> select * from tdiag where diag_id = 1234;
Yes. IIRC the performance penalty for using non-leading column of an index
is negligible. But why don't you try that on your own - just run an
explain and you'll get an immediate answer if that works.
regards
Tomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tv@fuzzy.cz, anthony.shipman@symstream.com, klaussfreire@gmail.com, pavel.stehule@gmail.com
Subject: Re: strange query plan with LIMIT
In-Reply-To: <9f040b694b5b87c5ab1754b37e367e10.squirrel@sq.gransy.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox