X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 34EC952956 for ; Thu, 30 Jun 2005 19:35:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42223-02 for ; Thu, 30 Jun 2005 22:35:36 +0000 (GMT) Received: from hosting.commandprompt.com (128.commandprompt.com [207.173.200.128]) by svr1.postgresql.org (Postfix) with ESMTP id 73F455281B for ; Thu, 30 Jun 2005 19:35:36 -0300 (ADT) Received: from [192.168.1.52] (fc1smp [66.93.38.87]) (authenticated bits=0) by hosting.commandprompt.com (8.12.8/8.12.8) with ESMTP id j5UMZdoQ015762; Thu, 30 Jun 2005 15:35:39 -0700 Message-ID: <42C473BA.9090305@commandprompt.com> Date: Thu, 30 Jun 2005 15:35:38 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Mendenhall Cc: pgsql-performance@postgresql.org Subject: Re: ported application having performance issues References: <20050630222451.GA17628@calvin.surfutopia.net> In-Reply-To: <20050630222451.GA17628@calvin.surfutopia.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.85.1/960/Tue Jun 28 21:31:06 2005 on hosting.commandprompt.com X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.015 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/602 X-Sequence-Number: 13239 > Thank you very much in advance for any pointers you can > provide. And, if this is the wrong forum for this question, > please let me know and I'll ask it elsewhere. I think you may want to increase your statistics_target plus make sure you are running analyze. explain anaylze would do. Sincerely, Joshua D. Drake > > JohnM > > > > > > ----- > table definitions > ----- > > ----- > db=> \d contacts > Table "db.contacts" > Column | Type | Modifiers > ------------------------------+-----------------------------+----------- > id | numeric(38,0) | not null > db_id | character varying(32) | > firstname | character varying(64) | > lastname | character varying(64) | > company | character varying(128) | > email | character varying(256) | > phone | character varying(64) | > address | character varying(128) | > city | character varying(128) | > state | character varying(32) | > postalcode | character varying(16) | > country | character varying(2) | not null > contact_info_modified | character(1) | > token_id | numeric(38,0) | > status_id | numeric(38,0) | > status_last_modified | timestamp without time zone | > notes | character varying(2000) | > demo_schedule | timestamp without time zone | > partner_id | numeric(38,0) | > prev_partner_id | numeric(38,0) | > prev_prev_partner_id | numeric(38,0) | > site_last_visited | timestamp without time zone | > source_id | numeric(4,0) | > demo_requested | timestamp without time zone | > sourcebook_requested | timestamp without time zone | > zip | numeric(8,0) | > suffix | numeric(8,0) | > feedback_request_sent | timestamp without time zone | > products_sold | character varying(512) | > other_brand | character varying(512) | > printsample_requested | timestamp without time zone | > indoor_media_sample | timestamp without time zone | > outdoor_media_sample | timestamp without time zone | > printers_owned | character varying(256) | > business_type | character varying(256) | > printers_owned2 | character varying(256) | > contact_quality_id | numeric(38,0) | > est_annual_value | numeric(38,2) | > likelyhood_of_closing | numeric(38,0) | > priority | numeric(38,0) | > business_type_id | numeric(38,0) | > lead_last_modified | timestamp without time zone | > lead_value | numeric(38,2) | > channel_contact_flag | character(1) | > request_status_last_modified | timestamp without time zone | > master_key_number | numeric(38,0) | > master_key_token | character varying(32) | > current_media_cust | character(1) | > kodak_media_id | numeric(38,0) | > printer_sample_id | numeric(38,0) | > quantity_used_id | numeric(38,0) | > rip_used_id | numeric(38,0) | > language_code | character varying(3) | > region_id | numeric(38,0) | not null > lead_deleted | timestamp without time zone | > last_request_set_status_id | numeric(38,0) | > address2 | character varying(128) | > media_usage_id | numeric(38,0) | > Indexes: > "contacts_pkey" primary key, btree (id) > "contacts_partner_id_idx" btree (partner_id) > "contacts_partner_id_null_idx" btree (partner_id) WHERE (partner_id IS NULL) > "contacts_token_id_idx" btree (token_id) > Check constraints: > "sys_c0050644" CHECK (country IS NOT NULL) > "sys_c0050643" CHECK (id IS NOT NULL) > "sys_c0050645" CHECK (region_id IS NOT NULL) > Triggers: > insert_master_key BEFORE INSERT ON contacts FOR EACH ROW EXECUTE PROCEDURE pg_fct_insert_master_key() > ----- > > ----- > db=> \d lead_requests > Table "db.lead_requests" > Column | Type | Modifiers > -----------------------+-----------------------------+----------- > id | numeric(38,0) | not null > contact_id | numeric(38,0) | not null > request_id | numeric(38,0) | not null > date_requested | timestamp without time zone | not null > must_update_by | timestamp without time zone | > date_satisfied | timestamp without time zone | > status_id | numeric(38,0) | > request_scheduled | timestamp without time zone | > session_log_id | numeric(38,0) | > notes | character varying(2000) | > status_last_modified | timestamp without time zone | > reminder_last_sent | timestamp without time zone | > data | character varying(2000) | > fulfillment_status_id | numeric(38,0) | > Indexes: > "lead_requests_pkey" primary key, btree (id) > "lead_requests_contact_id_idx" btree (contact_id) > "lead_requests_request_id_idx" btree (request_id) > Check constraints: > "sys_c0049877" CHECK (request_id IS NOT NULL) > "sys_c0049876" CHECK (contact_id IS NOT NULL) > "sys_c0049878" CHECK (date_requested IS NOT NULL) > ----- > > -- Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240 PostgreSQL Replication, Consulting, Custom Programming, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/