Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Appending "LIMIT" to query drastically decreases performance



On Fri, 30 Nov 2007, cluster wrote:
> Can anyone explain the following odd behavior?
> I have a query that completes in about 90 ms. If I append LIMIT to the
> very end, eg. "LIMIT 500" the evaluation time increases to about 800 ms.
> How can performance get *worse* by giving the database the option to
> stop the evaluation earlier (when it reaches the output 500 rows)?

The planner doesn't always get it right. Simple.

Have you done a "VACUUM FULL ANALYSE" recently?

Matthew

-- 
It is better to keep your mouth closed and let people think you are a fool
than to open it and remove all doubt.                  -- Mark Twain



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group