[PERFORM] Query planner doesn't use index scan on tsvector GIN index if LIMIT is specified

2012-01-10 Thread darklow
Some info: PostgreSQL version: 9.1.2 Table "cache": Rows count: 3 471 081 Column "tsv" tsvector Index "cache_tsv" USING gin (tsv) If i do query like THIS: *SELECT id FROM table WHERE tsv @@ to_tsquery('test:*');* It uses index and returns results immediately: explain analyze 'Bitmap Heap Scan o

[PERFORM] Query planner doesn't use index scan on tsvector GIN index if LIMIT is specifiedQuery planner doesn't use index scan on tsvector GIN index if LIMIT is specified

2012-01-10 Thread darklow
Some info: PostgreSQL version: 9.1.2 Table "cache": Rows count: 3 471 081 Column "tsv" tsvector Index "cache_tsv" USING gin (tsv) If i do query like THIS: *SELECT id FROM table WHERE tsv @@ to_tsquery('test:*');* It uses index and returns results immediately: explain analyze 'Bitmap Heap Scan o