X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id ED52A9FB27C for ; Tue, 29 Aug 2006 11:10:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 41643-08 for ; Tue, 29 Aug 2006 11:10:03 -0300 (ADT) X-Greylist: delayed 00:16:47.733013 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 5918B9FB258 for ; Tue, 29 Aug 2006 11:09:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from relay03.is.co.za (relay03.is.co.za [196.35.6.71]) by svr4.postgresql.org (Postfix) with ESMTP id 409405AF8D9 for ; Tue, 29 Aug 2006 13:53:04 +0000 (GMT) Received: from relay03.is.co.za (localhost [127.0.0.1]) by relay03.is.co.za (Postfix) with ESMTP id F22CE314FDC for ; Tue, 29 Aug 2006 15:53:00 +0200 (SAST) Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) by relay03.is.co.za (Postfix) with ESMTP id D8786314FA9 for ; Tue, 29 Aug 2006 15:53:00 +0200 (SAST) Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) by smtp02.isdsl.net (Postfix) with ESMTP id 1F8792E15F for ; Tue, 29 Aug 2006 15:52:59 +0200 (SAST) Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with Microsoft SMTPSVC(6.0.3790.1830); Tue, 29 Aug 2006 15:56:43 +0200 Message-ID: <44F446B2.2090900@studentvillage.co.za> Date: Tue, 29 Aug 2006 15:52:50 +0200 From: Willo van der Merwe User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: PostgreSQL performance issues Content-Type: multipart/alternative; boundary="------------080008020200000500000601" X-OriginalArrivalTime: 29 Aug 2006 13:56:44.0046 (UTC) FILETIME=[F5FEBAE0:01C6CB72] X-Virus-Scanned: ClamAV using ClamSMTP at relay03.dial-up.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.27 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200608/453 X-Sequence-Number: 20638 This is a multi-part message in MIME format. --------------080008020200000500000601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, We're running PostgreSQL 8.1.4 on CentOS 4 (Linux version 2.6.9-34.0.1.ELsmp). Hardware specs: 2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 Cache Socket 940 4 GB Registered ECC PC3200 DDR RAM SuperMicro Server-Class 1U AS1020S series system Dual-channel Ultra320 SCSI controller 1 x 73 GB 10,000rpm Ultra320 SCSI drive with 8MB cache I use it to drive a web application. Everything was working fine when all of a sudden today, things went belly up. Load on the server started increasing and query speeds decreased rapidly. After dropping all the clients I did some quick tests and found the following: I have a log table looking like this: Table "public.log" Column | Type | Modifiers ---------+-----------------------------+--------------------------------- site | bigint | not null stamp | timestamp without time zone | default now() type | character(8) | not null default 'log'::bpchar user | text | not null default 'public'::text message | text | Indexes: "fki_log_sites" btree (site) "ix_log_stamp" btree (stamp) "ix_log_type" btree ("type") "ix_log_user" btree ("user") Foreign-key constraints: "log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE CASCADE ON DELETE CASCADE and it has 743321 rows and a explain analyze select count(*) from property_values; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=55121.95..55121.96 rows=1 width=0) (actual time=4557.797..4557.798 rows=1 loops=1) -> Seq Scan on property_values (cost=0.00..51848.56 rows=1309356 width=0) (actual time=0.026..2581.418 rows=1309498 loops=1) Total runtime: 4557.978 ms (3 rows) 4 1/2 seconds for a count(*) ? This seems a bit rough - is there anything else I can try to optimize my Database? You can imagine that slightly more complex queries goes out the roof. Any help appreciated Regards Willo van der Merwe --------------080008020200000500000601 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,

We're running PostgreSQL 8.1.4 on CentOS 4 (Linux version 2.6.9-34.0.1.ELsmp). Hardware specs:
2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 Cache Socket 940
4 GB Registered ECC PC3200 DDR RAM
SuperMicro Server-Class 1U AS1020S series system
Dual-channel Ultra320 SCSI controller
1 x 73 GB 10,000rpm Ultra320 SCSI drive with 8MB cache
I use it to drive a web application. Everything was working fine when all of a sudden today, things went belly up. Load on the server started increasing and query speeds decreased rapidly. After dropping all the clients I did some quick tests and found the following:

I have a log table looking like this:
                           Table "public.log"
 Column  |            Type             |            Modifiers
---------+-----------------------------+---------------------------------
 site    | bigint                      | not null
 stamp   | timestamp without time zone | default now()
 type    | character(8)                | not null default 'log'::bpchar
 user    | text                        | not null default 'public'::text
 message | text                        |
Indexes:
    "fki_log_sites" btree (site)
    "ix_log_stamp" btree (stamp)
    "ix_log_type" btree ("type")
    "ix_log_user" btree ("user")
Foreign-key constraints:
    "log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE CASCADE ON DELETE CASCADE

and it has 743321 rows and a explain analyze select count(*) from property_values;
                                                            QUERY PLAN                                                       
----------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=55121.95..55121.96 rows=1 width=0) (actual time=4557.797..4557.798 rows=1 loops=1)
   ->  Seq Scan on property_values  (cost=0.00..51848.56 rows=1309356 width=0) (actual time=0.026..2581.418 rows=1309498 loops=1)
 Total runtime: 4557.978 ms
(3 rows)

4 1/2 seconds for a count(*) ? This seems a bit rough - is there anything else I can try to optimize my Database? You can imagine that slightly more complex queries goes out the roof.

Any help appreciated

Regards

Willo van der Merwe
--------------080008020200000500000601--