Re: Performance trouble finding records through related records - Mailing list pgsql-performance

From sverhagen
Subject Re: Performance trouble finding records through related records
Date
Msg-id 1299583062773-3413801.post@n5.nabble.com
Whole thread Raw
In response to Re: Performance trouble finding records through related records  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
Hi. Thanks for your response.


Robert Haas wrote:
>
> Join Filter: ((events_events.transactionid)::text =
> (customerdetails.transactionid)::text)
>
> Now why is there a cast to text there on both sides?  Do those two
> columns have exactly the same datatype?  If not, you probably want to
> fix that, as it can make a big difference.
>

Good question. I seem not able to get rid of that, even though these are
same type:

    =# \d events_events
    Table "public.events_events"
            Column        |           Type           | Modifiers
    ----------------------+--------------------------+----------
    [snip]
     transactionid        | character varying(36)    | not null
    [snip]

    =# \d events_eventdetails
    Table "public.events_eventdetails"
        Column     |          Type          | Modifiers
    ---------------+------------------------+----------
    [snip]
     transactionid | character varying(36)  | not null
    [snip]

(These columns allowing null or not is just something I've been playing with
to no avail too.)



Robert Haas wrote:
>
> Also, how many rows are there in events_events and how many in
> events_eventdetails?
>

select count(*) from events_events; --> 3910163
select count(*) from events_eventdetails; --> 30216033
select count(*) from events_eventdetails_customer_id; (single partition) -->
2976101


--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Performance-trouble-finding-records-through-related-records-tp3405914p3413801.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.

pgsql-performance by date:

Previous
From: Andreas Forø Tollefsen
Date:
Subject: Re: Performance issues
Next
From: sverhagen
Date:
Subject: Re: Performance trouble finding records through related records