Re: More records after sort - Mailing list pgsql-general

From Rob Sargent
Subject Re: More records after sort
Date
Msg-id 44CF8418-C67F-405C-BD36-763F4F2412E4@gmail.com
Whole thread Raw
In response to Re: More records after sort  (Nicolas Seinlet <nicolas@seinlet.com>)
Responses Re: More records after sort  (Nicolas Seinlet <nicolas@seinlet.com>)
List pgsql-general
Query:
INSERT INTO invl_aml_mapping_temp(invl_id, aml_id, cond)
               SELECT il.id, ml.id, 48
                   FROM account_invoice_line il
                   JOIN account_invoice i ON i.id = il.invoice_id
                   JOIN account_move m ON m.id = i.move_id
                   JOIN account_move_line ml ON ml.move_id = m.id
                   JOIN res_company comp ON comp.id = i.company_id
               WHERE il.display_type IS NULL
                 AND ml.tax_line_id IS NULL
                 AND NOT EXISTS (SELECT invl_id FROM invl_aml_mapping WHERE invl_id=il.id)
                 AND NOT EXISTS (SELECT aml_id FROM invl_aml_mapping WHERE aml_id=ml.id)
                 AND i.id

Out of curiosity, would combining those two NOT EXISTS in one help? Ever? 
i.e. WHERE invl_id=il.id or aml_id = ml.id


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: More records after sort
Next
From: WR
Date:
Subject: Obsolete or dead serverconnections after reboot