From: Magers, James <James.Magers@turner.com>
To: Tomas Vondra <tv@fuzzy.cz>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Query Performance question
Date: Mon, 14 Jul 2014 02:20:49 +0000
Message-ID: <1405304448354.64039@turner.com> (raw)
In-Reply-To: <53C32B20.8010100@fuzzy.cz>
References: <1405292142269.59034@turner.com>
<53C32B20.8010100@fuzzy.cz>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Tomas,
Thank you for your feedback. I am attaching the requested information. While I do not think the query is necessarily inefficient, I believe a sequence scan would be more efficient.
\d member_subscription_d
Table "public.member_subscription_d"
Column | Type | Modifiers
-----------------------+--------------------------+-----------------------------------------------------------------
subscription_key | bigint | not null default nextval('subscription_id_seq'::regclass)
version | integer | not null
date_from | timestamp with time zone |
date_to | timestamp with time zone |
newsletter_nme | character varying(50) |
subscription_platform | character varying(50) |
subscription_value | character varying(255) |
subscription_status | character varying(100) |
list_status | character varying(25) |
current_status | boolean |
unsubscribetoken | character varying(200) |
transaction_date | timestamp with time zone |
newsletter_sts | integer |
Indexes:
"member_subscription_key" PRIMARY KEY, btree (subscription_key)
"idx_member_subscription_d_list_status" btree (list_status)
"idx_member_subscription_d_newsletter_nme" btree (newsletter_nme)
"idx_member_subscription_d_subscription_status" btree (subscription_status)
"idx_member_subscription_d_subscription_value" btree (subscription_value)
"idx_member_subscription_d_tk" btree (subscription_key)
Referenced by:
TABLE "member_recipient_f" CONSTRAINT "member_subscription_d_recipient_f_fk" FOREIGN KEY (subscription_key) REFERENCES member_subscription_d(subscription_key)
pgahq_datamart-# FROM pg_class WHERE relname = 'member_subscription_d';
relname | relpages | reltuples
-----------------------+----------+-----------
member_subscription_d | 1383 | 63012
(1 row)
Explain output:
http://explain.depesz.com/s/OVK
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: James.Magers@turner.com, tv@fuzzy.cz
Subject: Re: Query Performance question
In-Reply-To: <1405304448354.64039@turner.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox