From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: DI Hasenöhrl <i.hasenoehrl@aon.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: make query faster??
Date: Tue, 4 Dec 2001 13:26:39 -0800 (PST)
Message-ID: <20011204131843.I6514-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <004a01c17d06$5f61b840$01011eac@irina>
On Tue, 4 Dec 2001, [iso-8859-1] DI Hasenöhrl wrote:
> I've a simple query, but when I use *ORDER BY* it takes a long time
> till I can see the result.
>
> a_nr is varchar(20) and the primary key of my table artikel.
>
> Please, can someone give me a hint, how to improve my query.
If you have not yet done so, you may want to increase sort_mem in your
postgresql.conf assuming you have sufficient memory in your machine
(and shared_buffers while you're at it). The defaults are fairly low and
you may see a performance gain in general if you raise them to amounts
more reasonable for your machine.
> In Bruce Momjian's book I read, that indexes are usually not used for
> ORDER BY operations: a sequential scan followed by an explicit sort is
> fatser than an indexscan.
>
> What's an explicit sort????????
Actually sorting the results of the sequence scan rather than using the
fact that the index keys can be gotten in sorted order to get the rows
in order.
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-sql@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, i.hasenoehrl@aon.at
Subject: Re: make query faster??
In-Reply-To: <20011204131843.I6514-100000@megazone23.bigpanda.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