pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: DI Hasenöhrl <i.hasenoehrl@aon.at>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: make query faster??
Date: Wed, 5 Dec 2001 09:52:52 +0100
Message-ID: <003601c17d6a$398f9100$01011eac@irina> (raw)
References: <20011204131843.I6514-100000@megazone23.bigpanda.com>

Thank you for your response, but I'm not quite clear.

Is *sort_mem* the same as postgres' starting option -S *Sortsize*, which is by default 512Kb

At this time I increased sortsize to 1024Kb, but the costs from explain are the same as before and I can't see, that the query is faster

Please, can you explain, what *cost=341.63..341.63* means

Thank you for your advices
-Irina
  ----- Original Message ----- 
  From: Stephan Szabo 
  To: DI Hasenöhrl 
  Cc: pgsql-sql@postgresql.org 
  Sent: Tuesday, December 04, 2001 10:26 PM
  Subject: Re: [SQL] make query faster??



  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.

view thread (4+ messages)  latest in thread

Message-ID: <003601c17d6a$398f9100$01011eac@irina>
Permalink:  ../003601c17d6a$398f9100$01011eac@irina/
Also on:    postgresql.org/message-id/003601c17d6a$398f9100$01011eac@irina

 · 

reply

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: i.hasenoehrl@aon.at, sszabo@megazone23.bigpanda.com
  Subject: Re: make query faster??
  In-Reply-To: <003601c17d6a$398f9100$01011eac@irina>

* 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