Re: Indexes on NULL's and order by ... limit N queries

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Maxim Boguk <mboguk(at)masterhost(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Indexes on NULL's and order by ... limit N queries
Date: 2008-12-01 20:41:44
Message-ID: 20081201204144.GL4459@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Maxim Boguk wrote:
> Sorry with all my respect to you, you look like wrong.

The difference is that the plan with -1 does not need to sort the
output, because it comes sorted out of the index; so the execution can
be stopped as soon as 5 tuples have come out. With NULL, that can't be
done.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoffrey 2008-12-01 20:43:01 Re: Monty on MySQL 5.1: "Oops, we did it again"
Previous Message Andrew Sullivan 2008-12-01 20:32:24 Re: Monty on MySQL 5.1: "Oops, we did it again"