QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.01..0.02 rows=1 width=88) (actual time=0.044..0.045 rows=0 loops=1) Buffers: shared hit=3 -> Sort (cost=0.01..0.02 rows=1 width=88) (actual time=0.042..0.043 rows=0 loops=1) Sort Key: created_at Sort Method: quicksort Memory: 25kB Buffers: shared hit=3 -> Seq Scan on messages (cost=0.00..0.00 rows=1 width=88) (actual time=0.010..0.011 rows=0 loops=1) Filter: ((chat_id = '00000000-0000-0000-0000-000000000002'::uuid) AND (created_at > (now() - '50 days'::interval))) Planning: Buffers: shared hit=79 dirtied=1 Planning Time: 0.771 ms Execution Time: 0.086 ms (12 rows)