CREATE TABLE tst AS SELECT x % 10000 id, 'abcxxxxxxxxxxxx'::text y
  FROM generate_series(1,1E5) AS x;
CREATE INDEX ON tst(id);

EXPLAIN ANALYZE
SELECT count(*) FROM tst WHERE id = 5 OR id = 50 OR id = 500 OR id = 5000
  OR id = 1 OR id = 10 OR id = 100 OR id = 1000 OR id = 10000 OR id > 20000;

EXPLAIN ANALYZE
SELECT count(*) FROM tst WHERE id = 5 OR id = 50 OR id = 500 OR id = 5000
  OR id = 1 OR id = 10 OR id = 100 OR id = 1000 OR id = 10000;

EXPLAIN ANALYZE
SELECT count(*) FROM tst WHERE id IN (5,50,500,5000,1,10,100,1000,10000);
