Edwin Grubbs <egrubbs(at)rackspace(dot)com> writes:
> I have a table with about 60,000 ips, and postgres will use the index to
> find the ips in a subnet if I type in a literal cidr block
> (e.g. address <<= '99.88.5.0'), but it will not use the index if the cidr
> block is in a variable (e.g. address <<= block).
Yup, the present implementation of that optimization depends on having
a constant to compare to. Sorry ...
regards, tom lane