pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Sidar López Cruz <sidarlopez@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: how postgresql request the computer resources
Date: Thu, 27 Oct 2005 16:56:49 +0100
Message-ID: <4360F8C1.4040202@archonet.com> (raw)
In-Reply-To: <BAY23-F28F5DD23A4A73C7BFE3CD1CE680@phx.gbl>
References: <BAY23-F28F5DD23A4A73C7BFE3CD1CE680@phx.gbl>

Sidar López Cruz wrote:
> Is there something that tells postgres to take the resorces from 
> computer (RAM, HDD, SWAP on linux) as it need, not modifying variables 
> on postgresql.conf and other operating system things?

Ah, and how is it to know what to share with other processes?

> A days ago i am trying to show that postgres is better than mssql but 
> when execute a simple query like:
> 
> (1)
> select count(*) from
> Total runtime: 134552.325 ms
> 
> (2)
> select count(*) from fotos where archivo not in (select archivo from 
> Total runtime: 26747.236 ms
> 
> (3)
> select count(1) from fotos f where not exists (select a.archivo from 
> Total runtime: 89765.714 ms
> 
> (4)
> SELECT count(*)
> Total runtime: 114893.116 ms

> WITH ANY OF THIS QUERIES MSSQL TAKES NOT MUCH OF 7 SECONDS....

In which case they make a bad choice for showing PostgreSQL is faster 
than MSSQL. Is this the only query you have, or are others giving you 
problems too?

I think count(*) is about the weakest point in PG, but I don't think 
there'll be a general solution available soon. As I'm sure someone has 
mentioned, whatever else, PG needs to check the row for its visibility 
information.

 From the start of your email, you seem to suspect your configuration 
needs some work. Once you are happy that your settings in general are 
good, you can override some by issuing set statements before your query. 
For example:
	SET work_mem = 10000;
might well improve example #2 where you had a hash.

--
   Richard Huxton
   Archonet Ltd




view thread (4+ messages)  latest in thread

Message-ID: <4360F8C1.4040202@archonet.com>
Permalink:  ../4360F8C1.4040202@archonet.com/
Also on:    postgresql.org/message-id/4360F8C1.4040202@archonet.com

 · 

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-performance@postgresql.org
  Cc: dev@archonet.com, sidarlopez@hotmail.com
  Subject: Re: how postgresql request the computer resources
  In-Reply-To: <4360F8C1.4040202@archonet.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