"Hans Ekbrand" <hans(dot)ekbrand(at)sociology(dot)gu(dot)se> writes:
> No, I just wanted to show the time differences, I haven't used join
> before. Now that you have adviced me to, I have tried your suggestion
> to rewrite B as a union and it works good! Just as fast as the A Query!
You can even do better. If you know the two sets of mid are disjoint you can
use UNION ALL. If not you could remove the two DISTINCTs as the UNION will
take care of removing duplicates.
Ask me about EnterpriseDB's On-Demand Production Tuning
In response to
pgsql-performance by date
|Next:||From: Jeffrey Baker||Date: 2008-04-23 16:40:23|
|Subject: Re: SELECT 'DBD::Pg ping test'|
|Previous:||From: PFC||Date: 2008-04-23 12:56:56|
|Subject: Re: mysterious difference in speed when combining two queries with OR|