Re: strange query plan with LIMIT

From: tv(at)fuzzy(dot)cz
To: anthony(dot)shipman(at)symstream(dot)com
Cc: tv(at)fuzzy(dot)cz, pgsql-performance(at)postgresql(dot)org, "Claudio Freire" <klaussfreire(at)gmail(dot)com>, "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: strange query plan with LIMIT
Date: 2011-06-10 11:22:58
Message-ID: 9f040b694b5b87c5ab1754b37e367e10.squirrel@sq.gransy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Anibal David Acosta 2011-06-10 11:29:14 how much postgres can scale up?
Previous Message Robert Klemme 2011-06-10 10:02:50 Re: [GENERAL] [PERFORMANCE] expanding to SAN: which portion best to move