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 9B1A032A169 for ; Wed, 29 Sep 2004 04:52:54 +0100 (BST) 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 66544-10 for ; Wed, 29 Sep 2004 03:52:18 +0000 (GMT) Received: from rambo.iniquinet.com (rambo.iniquinet.com [69.39.89.10]) by svr1.postgresql.org (Postfix) with ESMTP id 6B2D432A032 for ; Wed, 29 Sep 2004 04:52:14 +0100 (BST) Received: (qmail 19832 invoked by uid 1010); 28 Sep 2004 23:52:08 -0400 Received: from Robert_Creager@LogicalChaos.org by rambo.iniquinet.com by uid 1002 with qmail-scanner-1.20 (clamscan: 0.70. spamassassin: 2.64. Clear:RC:0(216.150.208.13):SA:0(-4.6/6.0):. Processed in 1.397411 secs); 29 Sep 2004 03:52:08 -0000 Received: from static-13.mm.den.viawest.net (HELO thunder.mshome.net) (perl?test@logicalchaos.org@216.150.208.13) by rambo.iniquinet.com with AES256-SHA encrypted SMTP; 28 Sep 2004 23:52:07 -0400 Received: from localhost.localdomain (thunder.mshome.net [192.168.0.250]) by thunder.mshome.net (Postfix) with ESMTP id 3AF1AA8237; Tue, 28 Sep 2004 21:52:06 -0600 (MDT) Received: from logicalchaos.org (thunder.mshome.net [192.168.0.250]) by thunder.mshome.net (Postfix) with SMTP id 72C83A8237; Tue, 28 Sep 2004 21:51:57 -0600 (MDT) Date: Tue, 28 Sep 2004 21:51:56 -0600 From: Robert Creager To: Kevin Barnard Cc: pgsql-performance@postgresql.org Subject: Re: This query is still running after 10 hours... Message-Id: <20040928215156.65c36a5a@thunder.mshome.net> In-Reply-To: References: <20040928081957.7a317a95@thunder.mshome.net> <20040928202140.4ea9d090@thunder.mshome.net> Organization: Starlight Vision, LLC. X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i586-mandrake-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Tue__28_Sep_2004_21_51_56_-0600_AR02941twMntN+Sx" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/320 X-Sequence-Number: 8448 --Signature=_Tue__28_Sep_2004_21_51_56_-0600_AR02941twMntN+Sx Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit When grilled further on (Tue, 28 Sep 2004 21:41:50 -0500), Kevin Barnard confessed: > On Tue, 28 Sep 2004 20:21:40 -0600, Robert Creager > wrote: > > > > The trigger keeps another table (catalog) up to date with the information > > from the obs_v and obs_i tables. There are no direct insert/update/delete's > > on the catalog table, only though the trigger. > > > > It's possible that the update to catalog is what is really taking a > long time. You might wish to try and explain that query just to make > sure. You might also wish to disable to trigger just to rule it out. > Does catalog have any triggers on it? Does it have any foreign keys? A select on the catalog is really quick (54ms on a random query - ~1M entries). The updates use the index. The catalog table has no triggers or foreign keys. The trigger on the obs_? tables manages the catalog table. tassiv=# \d catalog Table "public.catalog" Column | Type | Modifiers ------------------+------------------+------------------------------------------------- star_id | integer | not null default nextval('"star_id_seq"'::text) loc_count | integer | default 0 loc | spoint | not null ra_sum | double precision | default 0 ra_sigma | real | default 0 ra_sum_square | double precision | default 0 dec_sum | double precision | default 0 dec_sigma | real | default 0 dec_sum_square | double precision | default 0 mag_u_count | integer | default 0 mag_u | real | default 99 mag_u_sum | double precision | default 0 mag_u_sigma | real | default 0 mag_u_sum_square | double precision | default 0 mag_b_count | integer | default 0 mag_b | real | default 99 mag_b_sum | double precision | default 0 mag_b_sigma | real | default 0 mag_b_sum_square | double precision | default 0 mag_v_count | integer | default 0 mag_v | real | default 99 mag_v_sum | double precision | default 0 mag_v_sigma | real | default 0 mag_v_sum_square | double precision | default 0 mag_r_count | integer | default 0 mag_r | real | default 99 mag_r_sum | double precision | default 0 mag_r_sigma | real | default 0 mag_r_sum_square | double precision | default 0 mag_i_count | integer | default 0 mag_i | real | default 99 mag_i_sum | double precision | default 0 mag_i_sigma | real | default 0 mag_i_sum_square | double precision | default 0 Indexes: "catalog_pkey" primary key, btree (star_id) "catalog_ra_decl_index" gist (loc) -- 21:44:49 up 6 days, 11 min, 2 users, load average: 2.03, 2.17, 2.39 Linux 2.6.5-02 #8 SMP Mon Jul 12 21:34:44 MDT 2004 --Signature=_Tue__28_Sep_2004_21_51_56_-0600_AR02941twMntN+Sx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iEYEARECAAYFAkFaMVwACgkQLQ/DKuwDYzmYtwCfZjY2Thj7TIEYkXZLipFEC5NX oYYAniVsBAlm342Y4lagvurpgLAybs6G =Jg6r -----END PGP SIGNATURE----- --Signature=_Tue__28_Sep_2004_21_51_56_-0600_AR02941twMntN+Sx--