pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>
To: Scott Marlowe <scott.marlowe@gmail.com>
To: Jonathan Hoover <jhoover@yahoo-inc.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Get Postgres to use multiple proc cores?
Date: Fri, 5 Nov 2010 15:29:07 -0000
Message-ID: <7B7990F174D348D28AA43F21640F5EAE@marktestcr.marktest.pt> (raw)
References: <68C107706843A54BA7D9CAEF123ADF05010346C955@SP2-EX07VS03.ds.corp.yahoo.com>
	<AANLkTimU++2xbWzLeNxjVuA44Egwyb9WGa+1M7VnEYEN@mail.gmail.com>

Scott,

I'd like to take this chance to ask another (related though) question.

What is faster? A JOIN or a WHERE a IN (SELECT ... )

I've heard that the nested subquery has a tendency to be slower, but I'd 
like to check it with people from the list.
Is one faster than the other? Or, all in all, they run at the same speed ?

Best,
Oliveiros

----- Original Message ----- 
From: "Scott Marlowe" <scott.marlowe@gmail.com>
To: "Jonathan Hoover" <jhoover@yahoo-inc.com>
Cc: <pgsql-admin@postgresql.org>
Sent: Friday, November 05, 2010 3:17 PM
Subject: Re: [ADMIN] Get Postgres to use multiple proc cores?


On Fri, Nov 5, 2010 at 8:59 AM, Jonathan  Hoover <jhoover@yahoo-inc.com> 
wrote:
> With my hard drive issues from an earlier email solved (thanks all) I am 
> now running queries against my 65M rows. I noticed in atop that postmaster 
> is using 100% of just one processor core. Is there any way to tell it to 
> use both (or at least some of the other one). System is RHEL5, PG is 
> version 8.1.18 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 
> 20080704 (Red Hat 4.1.2-46). Intel Core 2 Duo, 4 GB RAM.
>
> The query in question has been running for 15 minutes, and the only thing 
> atop is reporting in the "red" is the processor. Although, just now the 
> proc has died down and the drive is apparently now "red" (the main delay 
> point). Here is the query (any help on improving it?)

A group by is almost always faster than a distinct.

And a single query uses a single core, sorry.

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin 




view thread (5+ messages)  latest in thread

Message-ID: <7B7990F174D348D28AA43F21640F5EAE@marktestcr.marktest.pt>
Permalink:  ../7B7990F174D348D28AA43F21640F5EAE@marktestcr.marktest.pt/
Also on:    postgresql.org/message-id/7B7990F174D348D28AA43F21640F5EAE@marktestcr.marktest.pt

 · 

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-admin@postgresql.org
  Cc: oliveiros.cristina@marktest.pt, scott.marlowe@gmail.com, jhoover@yahoo-inc.com
  Subject: Re: Get Postgres to use multiple proc cores?
  In-Reply-To: <7B7990F174D348D28AA43F21640F5EAE@marktestcr.marktest.pt>

* 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