Re: Query Performance question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux