I'd try to check why discounts are different. Join with 'or' should work.
Build (one query) except all (another query) and check some rows from
result.
13 лип. 2013 01:28, "Brian Fehrle" напис.
> On 07/11/2013 06:46 PM, Josh Berkus wrote:
>
>> Brian,
>>
>> 3. I'm trying to eliminate the union,
m]
Gesendet: Montag, 15. Juli 2013 18:12
An: pgsql-performance@postgresql.org
Betreff: Re: [PERFORM] Trying to eliminate union and sort
On 07/12/2013 04:43 PM, Josh Berkus wrote:
>> As for the counts on the tables:
>> table1 3,653,472
>> table2 2,191,314
>> table325,67
On 07/12/2013 04:43 PM, Josh Berkus wrote:
As for the counts on the tables:
table1 3,653,472
table2 2,191,314
table325,676,589
I think it's safe to assume right now that any resulting joins are not
one-to-one
Hmmm? How is doing a subselect in the SELECT clause even working, then?
> As for the counts on the tables:
> table1 3,653,472
> table2 2,191,314
> table325,676,589
>
> I think it's safe to assume right now that any resulting joins are not
> one-to-one
Hmmm? How is doing a subselect in the SELECT clause even working, then?
--
Josh Berkus
PostgreSQL
On 07/11/2013 06:46 PM, Josh Berkus wrote:
Brian,
3. I'm trying to eliminate the union, however I have two problems.
A) I can't figure out how to have an 'or' clause in a single join that
would fetch all the correct rows. If I just do:
LEFT OUTER JOIN table2 t2 ON (t2.real_id = t.id OR t2.real_
Brian,
> 3. I'm trying to eliminate the union, however I have two problems.
> A) I can't figure out how to have an 'or' clause in a single join that
> would fetch all the correct rows. If I just do:
> LEFT OUTER JOIN table2 t2 ON (t2.real_id = t.id OR t2.real_id =
> t.backup_id), I end up with man
Hi All,
(basic info)
PostgreSQL 9.2.4
64 bit Linux host
4GB shared_buffers with 14GB system memory, dedicated database VM
10MB work_mem
I have a query that takes over 6 minutes to complete, and it's due
mainly to the two sorting operations being done on this query. The data
it is returning it