QUERY PLAN Limit (cost=2285.01..5180.32 rows=61 width=2158) (actual time=5351.382..5351.399 rows=61 loops=1) -> Incremental Sort (cost=2285.01..1242947.06 rows=26139 width=2158) (actual time=5351.381..5351.393 rows=61 loops=1) " Sort Key: products.pinned_at, products.listed_at DESC" Presorted Key: products.pinned_at Full-sort Groups: 1 Sort Method: quicksort Average Memory: 266kB Peak Memory: 266kB Pre-sorted Groups: 1 Sort Method: top-N heapsort Average Memory: 362kB Peak Memory: 362kB -> Nested Loop (cost=0.86..1241366.91 rows=26139 width=2158) (actual time=5.292..5308.158 rows=18411 loops=1) -> Index Scan Backward using products_pinned_at_ix on products (cost=0.43..1172249.47 rows=26139 width=1460) (actual time=5.263..5203.180 rows=18411 loops=1) Filter: ((desc_tsv @@ '''nike'':*'::tsquery) AND (status = 'published'::prod_status)) Rows Removed by Filter: 5415895 -> Memoize (cost=0.43..3.64 rows=1 width=698) (actual time=0.004..0.004 rows=1 loops=18411) Cache Key: products.shop_id Cache Mode: logical Hits: 10434 Misses: 7977 Evictions: 505 Overflows: 0 Memory Usage: 8194kB -> Index Scan using shops_pkey on shops (cost=0.42..3.63 rows=1 width=698) (actual time=0.005..0.005 rows=1 loops=7977) Index Cond: (id = products.shop_id) Planning Time: 0.813 ms Execution Time: 5353.360 ms