[Bucardo-general] [SOLVED] b5 / pg84 : "arguments of row IN must all be row expressions"

Rosser Schwarz rosser.schwarz at gmail.com
Thu Sep 20 04:33:12 UTC 2012


On Wed, Sep 19, 2012 at 1:26 PM, Bill McGonigle <bill at bfccomputing.com> wrote:
> On 09/19/2012 03:39 PM, Bill McGonigle wrote:
>> Will see where that's generated next...
> I didn't quite figure out the code but I got far enough to understand what was happening.  I think this is probably a reportable bug in b5.

I think the DELETE statement is being generated in the block from
8087-8108 in Bucardo.pm, in the delete_rows sub, which begins at 7878.
Particularly, the IN() list is being generated via the map {}
statement at 8095.  (All line numbers are as of a fresh pull.)

Unf., I don't seem to have sufficient brain right now to suss out how
that's happening.  Two somewhat related thoughts from looking at the
code, however:

1. I can't see any difference between the PGIN block (8087-8108) and
the "vanilla" IN block (8025-8046), save the condition in the elsif.
Am I missing something screamingly obvious (witness my confessed
present lack of brain), or was this something that was previously
different, or planned to be different later?  If not, should those
blocks be consolidated?

2. If the motivation for using a limited chunk size for IN() blocks is
that they're known to lose performance-wise in postgres when they get
very large, might it be useful to refactor the IN() list into a DELETE
... USING (VAUES...)?  E.g.:

DELETE FROM schema.table st
USING (VALUES(v1),(v2),(v3)...(vN)) deletelist(val)
WHERE st.pkey = val;

I've found that refactoring IN() lists (especially large such) into
joins against VALUES clauses is often a significant performance win.

rls

-- 
:wq


More information about the Bucardo-general mailing list