Get Postgres to use multiple proc cores?

From: "Jonathan Hoover" <jhoover(at)yahoo-inc(dot)com>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Get Postgres to use multiple proc cores?
Date: 2010-11-05 14:59:52
Message-ID: 68C107706843A54BA7D9CAEF123ADF05010346C955@SP2-EX07VS03.ds.corp.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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 | b |
--------------|---------------
|guid vc(32) | guid vc(32) |
|unitid vc(15)| unitid vc(15)|
|ftime ts | |
|source vc(10)| |
------------------------------
|65,000,000 rw| 500,000 rows |
------------------------------

SELECT DISTINCT guid FROM b
WHERE guid NOT IN (SELECT DISTINCT guid FROM a) AND
unitid IN (SELECT DISTINCT unitid FROM a)

Eventually, I want to project b.unitid and group by it, with a count(b.guid).

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2010-11-05 15:17:18 Re: Get Postgres to use multiple proc cores?
Previous Message Kevin Grittner 2010-11-05 13:43:00 Re: PANIC killing vacuum process