Michael Crozier crozierm
Fri Sep 2 20:34:33 PDT 2005
> >========================================================
> > select [columns] from .sl_log_1
> > where
> > ? log_origin = <origin>
> > ? and
> > ? ? ( ?
> > ? ? ? ?( ? log_tableid in ( ?[tableid's from set 1] ?and ?<xid filter> )
> > ? ? ? ?or
> > ? ? ? ?( ? log_tableid in ( ?[tableid's from set 2] ?and ?<xid filter> )
> > ? ? ?)
> > ? ? ) order by log_actionseq;
> >
> >This:
> >========================================================
> > select [columns] from .sl_log_1
> > where
> > ? log_origin = <origin>
> > ? and ?log_tableid in ?[tableid's from sets 1 & 2]
> > ? and ?<xid filter>
> > order by log_actionseq;
> > ?
>
> The thing is, the second query /isn't/ equivalent to the first one.

They aren't equivalent?  Perhaps the I'm only seeing simplistic cases.  

Assuming that the "xid filter" part of the query is the same:
Let
   W = "origin = <originId>"
   X = "log_tableid in setA"
   Y = "log_tableid in setB"
   Z = "xid/xid_snapshot filter"

The original query is: W and ( ( X and Z) or (Y and Z) )
Reduces to: W and (X or Y) and Z

As "X or Y"   is    "(log_tableid in setA) or (log_tableid in setB)"
This should be equivalent to "log_tableid in (setA union setB)"






More information about the Slony1-general mailing list