Re: [HACKERS] Solution for LIMIT cost estimation

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Chris <chris(at)bitmead(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Solution for LIMIT cost estimation
Date: 2000-02-14 15:05:19
Message-ID: 3.0.1.32.20000214070519.0170d150@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:47 PM 2/14/00 +1100, Chris wrote:

>Only that it's non intuitive that ORDER BY should change the actual
>results of a series of LIMIT queries, not just the order. If there are
>100 records, and I do 10x LIMIT 10,offset queries one might expect to
>get all 100 records.

The only person who will expect that is the person who hasn't bothered
to learn the fundamental SQL property that rows returned by queries
come back in non-deterministic order.

This is a FUNDAMENTAL concept in SQL, one that is mentioned in every
SQL book I've seen.

The same person probably expects NULL = NULL to return true, too.

So what?

> And currently you do (barring something unusual
>like a vacuum at an inopportune moment that drastically changes
>statistics).

Or an insert by another back end, not at all uncommon in the
kind of web environment where this construct is frequently
used.

>I'm just playing devils advocate here. Changing this is probably not
>going to hurt me, I just think it could confuse a lot of people.

See above.

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2000-02-14 15:14:01 Re: [HACKERS] Solution for LIMIT cost estimation
Previous Message Don Baccus 2000-02-14 14:59:18 Re: [HACKERS] Solution for LIMIT cost estimation