Using indices for UNION

https://commitfest.postgresql.org/action/patch_view?id=1279
http://archives.postgresql.org/message-id/20131113.172503.54382268.horiguchi.kyotaro@lab.ntt.co.jp