********* master, frequent term: test=# explain analyze select count(*) from pglist where fts @@ to_tsquery( 'simple', 'tom & lane' ); QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=112620.76..112620.77 rows=1 width=8) (actual time=19862.702..19862.702 rows=1 loops=1) -> Bitmap Heap Scan on pglist (cost=542.90..112486.92 rows=53535 width=0) (actual time=1502.176..19743.815 rows=222813 loops=1) Recheck Cond: (fts @@ '''tom'' & ''lane'''::tsquery) Heap Blocks: exact=105992 -> Bitmap Index Scan on pglist_fts_rum (cost=0.00..529.51 rows=53535 width=0) (actual time=1441.195..1441.195 rows=222813 loops=1) Index Cond: (fts @@ '''tom'' & ''lane'''::tsquery) Planning time: 180.332 ms Execution time: 19865.841 ms (8 rows) ********* index-only, frequent term: test=# explain analyze select count(*) from pglist where fts @@ to_tsquery( 'simple', 'tom & lane' ); QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=56911.69..56911.70 rows=1 width=8) (actual time=1543.316..1543.316 rows=1 loops=1) -> Bitmap Heap Scan on pglist (cost=542.01..56778.14 rows=53420 width=0) (actual time=1496.301..1529.001 rows=222813 loops=1) Recheck Cond: (fts @@ '''tom'' & ''lane'''::tsquery) Heap Blocks: exact=105992 Heap Fetches: 0 -> Bitmap Index Scan on pglist_fts_rum (cost=0.00..528.65 rows=53420 width=0) (actual time=1457.597..1457.597 rows=222813 loops=1) Index Cond: (fts @@ '''tom'' & ''lane'''::tsquery) Planning time: 221.965 ms Execution time: 1545.217 ms (9 rows) ********* master, infrequent term: test=# set work_mem to 8192; explain analyze select count(*) from pglist where fts @@ to_tsquery( 'simple', 'ildus' ); SET QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=17514.67..17514.68 rows=1 width=8) (actual time=331.773..331.774 rows=1 loops=1) -> Bitmap Heap Scan on pglist (cost=71.28..17502.00 rows=5069 width=0) (actual time=103.387..331.366 rows=143 loops=1) Recheck Cond: (fts @@ '''ildus'''::tsquery) Heap Blocks: exact=121 -> Bitmap Index Scan on pglist_fts_rum (cost=0.00..70.02 rows=5069 width=0) (actual time=64.870..64.870 rows=143 loops=1) Index Cond: (fts @@ '''ildus'''::tsquery) Planning time: 205.332 ms Execution time: 332.806 ms ********* index-only, infrequent term: test=# set work_mem to 8192; explain analyze select count(*) from pglist where fts @@ to_tsquery( 'simple', 'ildus' ); SET QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=8830.99..8831.00 rows=1 width=8) (actual time=145.989..145.989 rows=1 loops=1) -> Bitmap Heap Scan on pglist (cost=71.28..8818.32 rows=5069 width=0) (actual time=115.310..145.924 rows=143 loops=1) Recheck Cond: (fts @@ '''ildus'''::tsquery) Heap Blocks: exact=121 -> Bitmap Index Scan on pglist_fts_rum (cost=0.00..70.02 rows=5069 width=0) (actual time=57.375..57.375 rows=143 loops=1) Index Cond: (fts @@ '''ildus'''::tsquery) Planning time: 196.365 ms Execution time: 146.677 ms (8 rows)