ORDER BY...LIMIT optimization does not work with inherited tables

From: "Marshall, Steve" <smarshall(at)wsi(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: ORDER BY...LIMIT optimization does not work with inherited tables
Date: 2008-05-07 12:38:05
Message-ID: 4821A2AD.6030908@wsi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PostgreSQL 8.3 added a new optimization to avoid sorting in queries that
use ORDER BY ... LIMIT. This optimization does not work when the query
is issued to a parent table with several children, such as a partitioned
table.

PostgreSQL version: 8.3.1
Operating System: RedHat Enterprise Linux 4

The attached example shows a query to a single table that uses the ORDER
BY ... LIMIT optimization. Then it shows that the query does not
optimize (uses sort) when executed to the parent of that table. Execute
as a user that can create databases as "psql -f
order_by_limit_partition_test.sql postgres". It creates a database
called test_order_by_limit_db.

Attachment Content-Type Size
order_by_limit_partition_test.sql text/plain 2.7 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2008-05-07 14:42:55 Re: BUG #4024: xpath() results lose namespace mappings
Previous Message Peter Eisentraut 2008-05-07 11:52:37 Re: BUG: aliases does not work ((