Re: Performance trouble finding records through related records

From: sverhagen <sverhagen(at)wps-nl(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance trouble finding records through related records
Date: 2011-03-08 11:17:42
Message-ID: 1299583062773-3413801.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message sverhagen 2011-03-08 11:31:43 Re: Performance trouble finding records through related records
Previous Message Andreas Forø Tollefsen 2011-03-08 08:42:13 Re: Performance issues