explain analyze select * from log_entries where user_name='john_doe' order by timestamp desc limit 100 offset 0; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit (cost=0.00..235.47 rows=100 width=175) (actual time=0.945..5.858 rows=100 loops=1) -> Index Scan Backward using timestamp_log_entries_key on log_entries (cost=0.00..39093.47 rows=16602 width=175) (actual time=0.938..5.622 rows=100 loops=1) Filter: ((user_name)::text = 'john_doe'::text) Total runtime: 6.175 ms (4 rows) explain analyze select * from log_entries where user_name like '%john_doe%' limit 100 offset 0; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Limit (cost=0.00..8250.17 rows=1 width=175) (actual time=0.495..3.364 rows=100 loops=1) -> Seq Scan on log_entries (cost=0.00..8250.17 rows=1 width=175) (actual time=0.486..3.138 rows=100 loops=1) Filter: ((user_name)::text ~~ '%john_doe%'::text) Total runtime: 3.657 ms (4 rows) explain analyze select * from log_entries where user_name like '%john_doe%' order by timestamp desc limit 100 offset 0; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- Limit (cost=8250.18..8250.19 rows=1 width=175) (actual time=1880.358..1880.910 rows=100 loops=1) -> Sort (cost=8250.18..8250.19 rows=1 width=175) (actual time=1880.345..1880.701 rows=100 loops=1) Sort Key: "timestamp" -> Seq Scan on log_entries (cost=0.00..8250.17 rows=1 width=175) (actual time=0.432..1051.036 rows=15481 loops=1) Filter: ((user_name)::text ~~ '%john_doe%'::text) Total runtime: 1887.071 ms (6 rows)