In article <2499(dot)1238420859(at)sss(dot)pgh(dot)pa(dot)us>,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> In particular, a constraint like "sel=123" is *not* going to lead the
> planner to draw any conclusions about the value of "mod(sel,6)".
> Now, if you'd written "WHERE mod(sel,6)=3", I think it would draw
> the right conclusions.
Yes, it does. It might be worthwile to use
WHERE sel=123 AND mod(sel,6)=3
I think you could use a rule to add the mod() condition automatically.