Re: Compound keys and foreign constraints - Mailing list pgsql-general

From Manfred Koizar
Subject Re: Compound keys and foreign constraints
Date
Msg-id vt9p6017tr5tfc09g1od031nbej0iibufp@email.aon.at
Whole thread Raw
In response to Re: Compound keys and foreign constraints  (<wespvp@SYNTEGRA.COM>)
Responses Re: Compound keys and foreign constraints
Re: Compound keys and foreign constraints
List pgsql-general
On Thu, 01 Apr 2004 16:45:23 -0600, <wespvp@SYNTEGRA.COM> wrote:
>db=> explain analyze select count(*) from messages m join (select * from
>db(> message_recipients r join addresses a on a.Address_Key=r.Recipient
>where
>db(> a.Address='lra.edi@edi.cma-cgm.com') as foo on
>db-> (m.Message_Key=foo.Message_Key AND (m.Message_Date >= '29-MAR-04') AND
>db(> (m.Message_Date <= '31-MAR-04 23:59:59'::timestamp without time zone));

I wonder whether we should try to talk the planner into using a hash or
merge join, but I fear I don't know enough yet.

Is there an index on message_recipients(Message_Key)?

How many rows satisfy

    SELECT * FROM messages WHERE Message_Date BETWEEN ... AND ... ?

And what are your settings for random_page_cost, effective_cache_size,
and sort_mem?

Servus
 Manfred

pgsql-general by date:

Previous
From:
Date:
Subject: Re: Compound keys and foreign constraints
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Some Aberdeen report