From: Ron Mayer <rm_pg@cheapcomplexdevices.com>
To: Josh Berkus <josh@agliodbs.com>
Subject: Re: half the query time in an unnecessary(?) sort?
Date: Mon, 25 Apr 2005 22:45:57 -0700
Message-ID: <426DD595.1040608@cheapcomplexdevices.com> (raw)
In-Reply-To: <200504251511.41949.josh@agliodbs.com>
References: <426D4FA1.1050000@cheapcomplexdevices.com>
<200504251511.41949.josh@agliodbs.com>
Josh Berkus wrote: [quoted out of order]
>Ron,
>
> Looking at your analyze, though, I think it's not the sort that's taking the
> time as it is that the full sorted entity_id column won't fit in work_mem.
> Try increasing it?
Yup, that indeed fixed this particular query since neither table was
particularly large.
> It still has to sort because the clustering isn't guarenteed to be 100%.
I guess I was contemplating whether or not there are some conditions
where it could be 100% (perhaps combined with Hannu's read only
table speculation).
> However, such sorts should be very quick as they have little work to do.
True, so long as the table can fit in work-mem. For much larger tables
IMHO it'd be nice to be able to simply do a seq-scan on them if there were
some way of knowing that they were sorted.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: rm_pg@cheapcomplexdevices.com, josh@agliodbs.com
Subject: Re: half the query time in an unnecessary(?) sort?
In-Reply-To: <426DD595.1040608@cheapcomplexdevices.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox