X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9A7B6D1D521 for ; Wed, 1 Oct 2003 03:16:01 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 18508-05 for ; Wed, 1 Oct 2003 00:15:15 -0300 (ADT) Received: from www.postgresql.com (unknown [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 978DAD1B8F5 for ; Tue, 30 Sep 2003 23:22:02 -0300 (ADT) Received: from boats_exch01.boats.com (h209-17-182-106.gtconnect.net [209.17.182.106]) by www.postgresql.com (Postfix) with ESMTP id 208A7CF4A47 for ; Tue, 30 Sep 2003 17:17:03 -0300 (ADT) Received: by BOATS_EXCH01 with Internet Mail Service (5.5.2653.19) id ; Tue, 30 Sep 2003 13:15:36 -0700 Received: from GRIFFITHS2 ([192.168.12.195]) by boats_exch01.boats.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id TTY64KC9; Tue, 30 Sep 2003 13:15:30 -0700 From: David Griffiths To: pgsql-performance@postgresql.org Message-ID: <058501c38790$f2525bf0$6501a8c0@griffiths2> Subject: Tuning/performance issue (part 2) Date: Tue, 30 Sep 2003 13:25:05 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_057D_01C38756.431EB910" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4922.1500 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=BAYES_30, HTML_30_40, RCVD_IN_OSIRUSOFT_COM X-Spam-Level: X-Archive-Number: 200310/2 X-Sequence-Number: 3750 This is a multi-part message in MIME format. ------=_NextPart_000_057D_01C38756.431EB910 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Here's the schema: =20 Table "public.address_list" Column | Type | Modifiers ----------------------+------------------------+----------- address_list_id | numeric(10,0) | not null address_1 | character varying(100) | address_2 | character varying(100) | address_3 | character varying(100) | city | character varying(100) | zip_code | character varying(20) | phone_num_1 | character varying(100) | phone_num_2 | character varying(100) | phone_num_fax | character varying(100) | state_province_id | numeric(10,0) | user_account_id | numeric(10,0) | marina_id | numeric(10,0) | commercial_entity_id | numeric(10,0) | address_type_id | numeric(10,0) | not null distributor_id | numeric(10,0) | contact_info_id | numeric(10,0) | country_id | numeric(10,0) | lang_id | numeric(10,0) | boat_listing_id | numeric(10,0) | Indexes: address_list_pkey primary key btree (address_list_id), addr_list_addr_type_id_i btree (address_type_id), addr_list_bl_id_i btree (boat_listing_id), addr_list_bl_sp_count_i btree (boat_listing_id, state_province_id, country_id), addr_list_ce_sp_c_at_c_i btree (commercial_entity_id, state_province_id, country_id, address_type_id, city), addr_list_ce_sp_countr_addr_type_i btree (commercial_entity_id, state_province_id, country_id, address_type_id), addr_list_ci_id_i btree (contact_info_id), addr_list_comm_ent_id_i btree (commercial_entity_id), addr_list_count_lang_i btree (country_id, lang_id), addr_list_country_id_i btree (country_id), addr_list_cty_bl_count_i btree (city, boat_listing_id, country_id), addr_list_cty_i btree (city), addr_list_distrib_id_i btree (distributor_id), addr_list_marina_id_i btree (marina_id), addr_list_sp_id_i btree (state_province_id), addr_list_ua_id_i btree (user_account_id) Foreign Key constraints: $1 FOREIGN KEY (address_type_id) REFERENCES address_type(address_type_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $2 FOREIGN KEY (commercial_entity_id) REFERENCES commercial_entity(commercial_entity_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $3 FOREIGN KEY (contact_info_id) REFERENCES contact_info(contact_info_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $4 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $5 FOREIGN KEY (state_province_id) REFERENCES state_province(state_province_id) ON UPDATE NO ACTION ON DELETE NO ACTION =20 Table "public.commercial_entity" Column | Type | Modifiers ---------------------------+-----------------------------+-------------- ----------------------------------------------- commercial_entity_id | numeric(10,0) | not null company_name | character varying(100) | not null website | character varying(200) | modify_date | timestamp without time zone | user_account_id | numeric(10,0) | source_id | numeric(10,0) | not null commercial_entity_type_id | numeric(10,0) | boats_website | character varying(200) | updated_on | timestamp without time zone | not null default ('now'::text)::timestamp(6) with time zone dealer_level_id | numeric(10,0) | lang_id | numeric(10,0) | default '100' yw_account_id | numeric(10,0) | keybank_dealer_code | numeric(10,0) | dnetaccess_id | numeric(10,0) | not null default 0 interested_in_dns | numeric(10,0) | not null default 0 parent_office_id | numeric(10,0) | marinesite_welcome_msg | character varying(500) | alt_marinesite_homepage | character varying(256) | comments | character varying(4000) | show_finance_yn | character varying(1) | not null default 'Y' show_insurance_yn | character varying(1) | not null default 'Y' show_shipping_yn | character varying(1) | not null default 'Y' yw_account_id_c | character varying(11) | sales_id | numeric(10,0) | Indexes: commercial_entity_pkey primary key btree (commercial_entity_id), comm_ent_boat_web_ui unique btree (boats_website), comm_ent_key_dlr_cd_ui unique btree (keybank_dealer_code), comm_ent_cny_name_i btree (company_name), comm_ent_dlr_lvl_id_i btree (dealer_level_id, lang_id), comm_ent_src_id_i btree (source_id), comm_ent_type_id_i btree (commercial_entity_type_id), comm_ent_upd_on btree (updated_on), comm_ent_usr_acc_id_i btree (user_account_id), comm_ent_yw_acc_id_i btree (yw_account_id) Foreign Key constraints: $1 FOREIGN KEY (source_id) REFERENCES source(source_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $2 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) ON UPDATE NO ACTION ON DELETE NO ACTION =20 Table "public.country" Column | Type | Modifiers --------------+------------------------+----------- country_id | numeric(10,0) | not null lang_id | numeric(10,0) | not null country_desc | character varying(100) | not null Indexes: country_pkey primary key btree (country_id) =20 Table "public.user_account" Column | Type | Modifiers -------------------------------+-----------------------------+---------- ------------------- user_account_id | numeric(10,0) | not null first_name | character varying(100) | first_name_display_ind | numeric(1,0) | not null last_name | character varying(100) | last_name_display_ind | numeric(1,0) | not null profession | character varying(100) | profession_display_ind | numeric(1,0) | not null self_description | character varying(100) | self_description_display_ind | numeric(1,0) | not null activity_interest | character varying(100) | activity_interest_display_ind | numeric(1,0) | not null make_brand | character varying(100) | make_brand_display_ind | numeric(1,0) | not null birth_date | timestamp without time zone | birth_date_display_ind | numeric(1,0) | not null my_boat_picture_link | character varying(200) | user_account_name | character varying(100) | not null password | character varying(100) | password_ind | numeric(1,0) | not null age | numeric(10,0) | blacklisted_ind | numeric(1,0) | not null auto_login_ind | numeric(1,0) | not null email_addr | character varying(100) | create_date | timestamp without time zone | default ('now'::text)::date lang_id | numeric(10,0) | not null user_role_id | numeric(10,0) | not null seller_type_id | numeric(10,0) | payment_method_id | numeric(10,0) | account_status_id | numeric(10,0) | not null source_id | numeric(10,0) | not null default 100 ebay_user_id | character varying(80) | ebay_user_password | character varying(80) | Indexes: user_account_pkey primary key btree (user_account_id), usr_acc_acc_stat_id_i btree (account_status_id), usr_acc_an_pass_i btree (user_account_name, "password"), usr_acc_email_addr_i btree (email_addr), usr_acc_first_name_i btree (first_name), usr_acc_lang_id_i btree (lang_id), usr_acc_last_name_i btree (last_name), usr_acc_pay_meth_id_i btree (payment_method_id), usr_acc_sell_type_id_i btree (seller_type_id), usr_acc_usr_acc_name_i btree (user_account_name), usr_acc_usr_role_id_i btree (user_role_id) Foreign Key constraints: $1 FOREIGN KEY (lang_id) REFERENCES lang(lang_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $2 FOREIGN KEY (source_id) REFERENCES source(source_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $3 FOREIGN KEY (user_role_id) REFERENCES user_role(user_role_id) ON UPDATE NO ACTION ON DELETE NO ACTION =20 Table "public.contact_info" Column | Type | Modifiers -----------------+------------------------+----------- contact_info_id | numeric(10,0) | not null first_name | character varying(100) | last_name | character varying(100) | email | character varying(100) | boat_listing_id | numeric(10,0) | user_account_id | numeric(10,0) | Indexes: contact_info_pkey primary key btree (contact_info_id), boat_listing_id_i btree (boat_listing_id), user_account_id_i btree (user_account_id) Foreign Key constraints: $1 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $2 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) ON UPDATE NO ACTION ON DELETE NO ACTION =20 Table "public.state_province" Column | Type | Modifiers ---------------------------+------------------------+----------- state_province_id | numeric(10,0) | not null state_province_short_desc | character varying(2) | state_province_desc | character varying(100) | not null country_id | numeric(10,0) | not null lang_id | numeric(10,0) | not null Indexes: state_province_pkey primary key btree (state_province_id), state_prov_count_lang_i btree (country_id, lang_id) =20 =20 All the join columns are the same type and width, and all are indexed. I googled for what looked like the expensive parts of the query to see if I could at least figure out where the time was being spent. =20 Part 3 to follow. =20 David ------=_NextPart_000_057D_01C38756.431EB910 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Here's the schema:
 
           =     =20 Table "public.address_list"
       = =20 Column       =20 |         =20 Type          |=20 Modifiers
----------------------+------------------------+----------- address_list_id     =20 | numeric(10,0)          | not= =20 null
 address_1        &nbs= p;  =20 | character varying(100)=20 |
 address_2         &= nbsp; =20 | character varying(100)=20 |
 address_3         &= nbsp; =20 | character varying(100)=20 |
 city          =       =20 | character varying(100)=20 |
 zip_code         &n= bsp;  =20 | character varying(20) =20 |
 phone_num_1         = ; |=20 character varying(100)=20 |
 phone_num_2         = ; |=20 character varying(100)=20 |
 phone_num_fax        | charac= ter=20 varying(100) |
 state_province_id    |=20 numeric(10,0)         =20 |
 user_account_id      |=20 numeric(10,0)         =20 |
 marina_id         &= nbsp; =20 | numeric(10,0)         =20 |
 commercial_entity_id |=20 numeric(10,0)         =20 |
 address_type_id      |=20 numeric(10,0)          | not= =20 null
 distributor_id       |=20 numeric(10,0)         =20 |
 contact_info_id      |=20 numeric(10,0)         =20 |
 country_id         =  =20 | numeric(10,0)         =20 |
 lang_id         &nb= sp;   =20 | numeric(10,0)         =20 |
 boat_listing_id      |=20 numeric(10,0)         =20 |
Indexes: address_list_pkey primary key btree=20 (address_list_id),
        =20 addr_list_addr_type_id_i btree=20 (address_type_id),
        =20 addr_list_bl_id_i btree=20 (boat_listing_id),
        =20 addr_list_bl_sp_count_i btree (boat_listing_id, state_province_id,=20 country_id),
        =20 addr_list_ce_sp_c_at_c_i btree (commercial_entity_id, state_province_id,=20 country_id, address_type_id,=20 city),
        =20 addr_list_ce_sp_countr_addr_type_i btree (commercial_entity_id,=20 state_province_id, country_id,=20 address_type_id),
        =20 addr_list_ci_id_i btree=20 (contact_info_id),
        =20 addr_list_comm_ent_id_i btree=20 (commercial_entity_id),
        = =20 addr_list_count_lang_i btree (country_id,=20 lang_id),
        =20 addr_list_country_id_i btree=20 (country_id),
        =20 addr_list_cty_bl_count_i btree (city, boat_listing_id,=20 country_id),
         addr_list_= cty_i=20 btree (city),
        =20 addr_list_distrib_id_i btree=20 (distributor_id),
        =20 addr_list_marina_id_i btree=20 (marina_id),
        =20 addr_list_sp_id_i btree=20 (state_province_id),
        =20 addr_list_ua_id_i btree (user_account_id)
Foreign Key constraints: $1 FO= REIGN=20 KEY (address_type_id) REFERENCES address_type(address_type_id) ON UPDATE NO= =20 ACTION ON DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $2 FOREIGN KEY (commercial_entity_id) REFERENCES=20 commercial_entity(commercial_entity_id) ON UPDATE NO ACTION ON DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $3 FOREIGN KEY (contact_info_id) REFERENCES contact_info(contact_info_id) O= N=20 UPDATE NO ACTION ON DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $4 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) O= N=20 UPDATE NO ACTION ON DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $5 FOREIGN KEY (state_province_id) REFERENCES state_province(state_province= _id)=20 ON UPDATE NO ACTION ON DELETE NO ACTION
 
           =             &nb= sp;            =       =20 Table=20 "public.commercial_entity"
       &nb= sp; =20 Column          =20 |           =20 Type            = ;=20 |            &n= bsp;            = ;=20 Modifiers
---------------------------+-----------------------------+----= ---------------------------------------------------------
 commerci= al_entity_id     =20 |=20 numeric(10,0)          &n= bsp;   =20 | not=20 null
 company_name        &= nbsp;    =20 | character varying(100)      | not=20 null
 website         =          =20 | character varying(200)     =20 |
 modify_date         = ;     =20 | timestamp without time zone=20 |
 user_account_id        &= nbsp; =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 source_id         &= nbsp;      =20 |=20 numeric(10,0)          &n= bsp;   =20 | not null
 commercial_entity_type_id |=20 numeric(10,0)          &n= bsp;   =20 |
 boats_website        &nb= sp;   =20 | character varying(200)     =20 |
 updated_on         =       =20 | timestamp without time zone | not null default ('now'::text)::timestamp(6= )=20 with time=20 zone
 dealer_level_id       &nbs= p;  =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 lang_id         &nb= sp;        =20 |=20 numeric(10,0)          &n= bsp;   =20 | default=20 '100'
 yw_account_id        = ;    =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 keybank_dealer_code       |=20 numeric(10,0)          &n= bsp;   =20 |
 dnetaccess_id        &nb= sp;   =20 |=20 numeric(10,0)          &n= bsp;   =20 | not null default=20 0
 interested_in_dns        = ; |=20 numeric(10,0)          &n= bsp;   =20 | not null default=20 0
 parent_office_id        =  =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 marinesite_welcome_msg    | character=20 varying(500)     =20 |
 alt_marinesite_homepage   | character=20 varying(256)     =20 |
 comments         &n= bsp;       =20 | character varying(4000)    =20 |
 show_finance_yn        &= nbsp; =20 | character varying(1)        | not null= =20 default=20 'Y'
 show_insurance_yn       &nb= sp; |=20 character varying(1)        | not null= =20 default=20 'Y'
 show_shipping_yn       &nbs= p; =20 | character varying(1)        | not null= =20 default=20 'Y'
 yw_account_id_c        = ;  =20 | character varying(11)      =20 |
 sales_id         &n= bsp;       =20 |=20 numeric(10,0)          &n= bsp;   =20 |
Indexes: commercial_entity_pkey primary key btree=20 (commercial_entity_id),
        = =20 comm_ent_boat_web_ui unique btree=20 (boats_website),
        =20 comm_ent_key_dlr_cd_ui unique btree=20 (keybank_dealer_code),
        = =20 comm_ent_cny_name_i btree=20 (company_name),
        =20 comm_ent_dlr_lvl_id_i btree (dealer_level_id,=20 lang_id),
         comm_ent_src_= id_i=20 btree (source_id),
        =20 comm_ent_type_id_i btree=20 (commercial_entity_type_id),
       &= nbsp;=20 comm_ent_upd_on btree=20 (updated_on),
        =20 comm_ent_usr_acc_id_i btree=20 (user_account_id),
        =20 comm_ent_yw_acc_id_i btree (yw_account_id)
Foreign Key constraints: $1= =20 FOREIGN KEY (source_id) REFERENCES source(source_id) ON UPDATE NO ACTION ON= =20 DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $2 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) O= N=20 UPDATE NO ACTION ON DELETE NO ACTION
 
           =   =20 Table "public.country"
    Column   =20 |         =20 Type          |=20 Modifiers
--------------+------------------------+-----------
 c= ountry_id  =20 | numeric(10,0)          | not= =20 null
 lang_id      |=20 numeric(10,0)          | not= =20 null
 country_desc | character varying(100) | not null
Indexes:= =20 country_pkey primary key btree (country_id)
 
           =             &nb= sp;       =20 Table=20 "public.user_account"
        &n= bsp;  =20 Column           &nb= sp;=20 |           =20 Type            = ;=20 |         =20 Modifiers
-------------------------------+-----------------------------+= -----------------------------
 user_account_id   &nb= sp;          =20 |=20 numeric(10,0)          &n= bsp;   =20 | not=20 null
 first_name        &nb= sp;          =20 | character varying(100)     =20 |
 first_name_display_ind       = |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 last_name        &nbs= p;           =20 | character varying(100)     =20 |
 last_name_display_ind       &= nbsp;=20 |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 profession        &nb= sp;          =20 | character varying(100)     =20 |
 profession_display_ind       = |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 self_description       &nb= sp;     =20 | character varying(100)     =20 |
 self_description_display_ind  |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 activity_interest       &n= bsp;    =20 | character varying(100)     =20 |
 activity_interest_display_ind |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 make_brand        &nb= sp;          =20 | character varying(100)     =20 |
 make_brand_display_ind       = |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 birth_date        &nb= sp;          =20 | timestamp without time zone=20 |
 birth_date_display_ind       = |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 my_boat_picture_link       = ;  =20 | character varying(200)     =20 |
 user_account_name        = ;    =20 | character varying(100)      | not=20 null
 password         = ;            = =20 | character varying(100)     =20 |
 password_ind        &nbs= p;        =20 |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 age         &nbs= p;            &= nbsp;   =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 blacklisted_ind        &= nbsp;     =20 |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 auto_login_ind        = ;       =20 |=20 numeric(1,0)          &nb= sp;    =20 | not=20 null
 email_addr        &nb= sp;          =20 | character varying(100)     =20 |
 create_date         = ;         =20 | timestamp without time zone | default=20 ('now'::text)::date
 lang_id      &nb= sp;            =    =20 |=20 numeric(10,0)          &n= bsp;   =20 | not=20 null
 user_role_id        &= nbsp;        =20 |=20 numeric(10,0)          &n= bsp;   =20 | not=20 null
 seller_type_id        = ;       =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 payment_method_id        = ;    =20 |=20 numeric(10,0)          &n= bsp;   =20 |
 account_status_id        = ;    =20 |=20 numeric(10,0)          &n= bsp;   =20 | not=20 null
 source_id        &nbs= p;           =20 |=20 numeric(10,0)          &n= bsp;   =20 | not null default=20 100
 ebay_user_id        &n= bsp;        =20 | character varying(80)      =20 |
 ebay_user_password       &nbs= p;   =20 | character varying(80)       |
Indexes:= =20 user_account_pkey primary key btree=20 (user_account_id),
        =20 usr_acc_acc_stat_id_i btree=20 (account_status_id),
        =20 usr_acc_an_pass_i btree (user_account_name,=20 "password"),
        =20 usr_acc_email_addr_i btree=20 (email_addr),
        =20 usr_acc_first_name_i btree=20 (first_name),
        =20 usr_acc_lang_id_i btree=20 (lang_id),
        =20 usr_acc_last_name_i btree=20 (last_name),
        =20 usr_acc_pay_meth_id_i btree=20 (payment_method_id),
        =20 usr_acc_sell_type_id_i btree=20 (seller_type_id),
        =20 usr_acc_usr_acc_name_i btree=20 (user_account_name),
        =20 usr_acc_usr_role_id_i btree (user_role_id)
Foreign Key constraints: $1= =20 FOREIGN KEY (lang_id) REFERENCES lang(lang_id) ON UPDATE NO ACTION ON DELET= E NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $2 FOREIGN KEY (source_id) REFERENCES source(source_id) ON UPDATE NO ACTION= ON=20 DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $3 FOREIGN KEY (user_role_id) REFERENCES user_role(user_role_id) ON UPDATE = NO=20 ACTION ON DELETE NO ACTION
 
           =  =20 Table "public.contact_info"
    =20 Column     =20 |         =20 Type          |=20 Modifiers
-----------------+------------------------+-----------
&nbs= p;contact_info_id=20 | numeric(10,0)          | not= =20 null
 first_name      | character varying(= 100)=20 |
 last_name       | character=20 varying(100)=20 |
 email          = ; |=20 character varying(100) |
 boat_listing_id |=20 numeric(10,0)         =20 |
 user_account_id |=20 numeric(10,0)         =20 |
Indexes: contact_info_pkey primary key btree=20 (contact_info_id),
        =20 boat_listing_id_i btree=20 (boat_listing_id),
        =20 user_account_id_i btree (user_account_id)
Foreign Key constraints: $1 FO= REIGN=20 KEY (user_account_id) REFERENCES user_account(user_account_id) ON UPDATE NO= =20 ACTION ON DELETE NO=20 ACTION,
          &nbs= p;            &= nbsp;=20 $2 FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id) O= N=20 UPDATE NO ACTION ON DELETE NO ACTION
 
           =      =20 Table=20 "public.state_province"
        =  =20 Column          =20 |         =20 Type          |=20 Modifiers
---------------------------+------------------------+---------= --
 state_province_id       &nbs= p;=20 | numeric(10,0)          | not= =20 null
 state_province_short_desc | character varying(2)  = =20 |
 state_province_desc       | charac= ter=20 varying(100) | not=20 null
 country_id        &nb= sp;      =20 | numeric(10,0)          | not= =20 null
 lang_id         =          =20 | numeric(10,0)          | not= =20 null
Indexes: state_province_pkey primary key btree=20 (state_province_id),
        =20 state_prov_count_lang_i btree (country_id, lang_id)
 
 
All the join columns are the same type and= width,=20 and all are indexed. I googled for what looked like the expensive parts of = the=20 query to see if I could at least figure out where the time was being=20 spent.
 
Part 3 to follow.
 
David
------=_NextPart_000_057D_01C38756.431EB910--