Re: [PERFORM] Performance trouble finding records through related records

2011-03-10 Thread sverhagen
Hi, all. I've done some further analysis, found a form that works if I split things over two separate queries (B1 and B2, below) but still trouble when combining (B, below). This is the full pseudo-query: SELECT FROM A UNION SELECT FROM B ORDER BY dateTime DESC LIMIT 50 In that pseudo-query:

Re: [PERFORM] Performance trouble finding records through related records

2011-03-08 Thread sverhagen
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,

Re: [PERFORM] Performance trouble finding records through related records

2011-03-08 Thread sverhagen
Merlin Moncure-2 wrote: 8.3? try converting the above to WHERE EXISTS or (even better) a JOIN... Thanks for that. But in my Mar 03, 2011; 10:19am post I already broke it down to the barebones with some variations, among which JOIN. The EXISTS IN variation was so poor that I left that

Re: [PERFORM] Performance trouble finding records through related records

2011-03-07 Thread Robert Haas
On Thu, Mar 3, 2011 at 9:55 AM, Andy Colson a...@squeakycode.net wrote: explain analyze SELECT events_events.* FROM events_events JOIN events_eventdetails customerDetails        ON events_events.transactionid = customerDetails.transactionid        AND customerDetails.keyname='customer_id'    

Re: [PERFORM] Performance trouble finding records through related records

2011-03-07 Thread Merlin Moncure
On Wed, Mar 2, 2011 at 6:12 PM, sverhagen sverha...@wps-nl.com wrote: Thanks for your help already! Hope you're up for some more :-) Andy Colson wrote: First off, excellent detail. Second, your explain analyze was hard to read... but since you are not really interested in your posted

Re: [PERFORM] Performance trouble finding records through related records

2011-03-03 Thread sverhagen
Andy Colson wrote: For your query, I think a join would be the best bet, can we see its explain analyze? Here is a few variations: SELECT events_events.* FROM events_events WHERE transactionid IN ( SELECT transactionid FROM events_eventdetails customerDetails WHERE

Re: [PERFORM] Performance trouble finding records through related records

2011-03-03 Thread Andy Colson
On 3/3/2011 3:19 AM, sverhagen wrote: Andy Colson wrote: For your query, I think a join would be the best bet, can we see its explain analyze? Here is a few variations: SELECT events_events.* FROM events_events WHERE transactionid IN ( SELECT transactionid FROM

Re: [PERFORM] Performance trouble finding records through related records

2011-03-02 Thread sverhagen
Thanks for your help already! Hope you're up for some more :-) Andy Colson wrote: First off, excellent detail. Second, your explain analyze was hard to read... but since you are not really interested in your posted query, I wont worry about looking at it... but... have you seen:

Re: [PERFORM] Performance trouble finding records through related records

2011-03-02 Thread Andy Colson
On 03/02/2011 06:12 PM, sverhagen wrote: Thanks for your help already! Hope you're up for some more :-) Andy Colson wrote: First off, excellent detail. Second, your explain analyze was hard to read... but since you are not really interested in your posted query, I wont worry about looking

Re: [PERFORM] Performance trouble finding records through related records

2011-03-01 Thread Andy Colson
On 03/01/2011 06:14 PM, sverhagen wrote: Hi, appreciated mailing list. Thanks already for taking your time for my performance question. Regards, Sander. ===POSTGRESQL VERSION AND ORIGIN=== PostgreSQL 8.3.9 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) Installed