explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WwMP

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 822,118.111 ↑ 1.0 4 1

Subquery Scan on tbl (cost=161,129.67..161,129.72 rows=4 width=8) (actual time=822,118.109..822,118.111 rows=4 loops=1)

2. 0.036 822,118.108 ↑ 1.0 4 1

Sort (cost=161,129.67..161,129.68 rows=4 width=0) (actual time=822,118.107..822,118.108 rows=4 loops=1)

  • Sort Key: (1)
  • Sort Method: quicksort Memory: 17kB
3. 0.043 822,118.072 ↑ 1.0 4 1

HashAggregate (cost=161,129.59..161,129.63 rows=4 width=0) (actual time=822,118.071..822,118.072 rows=4 loops=1)

  • Group Key: (1), (count(*))
4. 0.008 822,118.029 ↑ 1.0 4 1

Append (cost=160,832.43..161,129.57 rows=4 width=0) (actual time=822,097.653..822,118.029 rows=4 loops=1)

5. 250.901 822,097.651 ↑ 1.0 1 1

Aggregate (cost=160,832.43..160,832.44 rows=1 width=0) (actual time=822,097.651..822,097.651 rows=1 loops=1)

6. 821,846.750 821,846.750 ↓ 1.2 501,287 1

Index Only Scan using t_messages_action_id_idx on t_messages (cost=0.43..159,795.44 rows=414,794 width=0) (actual time=0.058..821,846.750 rows=501,287 loops=1)

  • Index Cond: (action_id = ANY ('{1,2}'::integer[]))
  • Heap Fetches: 56193
7. 0.012 17.723 ↑ 1.0 1 1

Aggregate (cost=110.80..110.81 rows=1 width=0) (actual time=17.723..17.723 rows=1 loops=1)

8. 17.711 17.711 ↑ 36.7 3 1

Index Scan using t_messages_processed_idx on t_messages t_messages_1 (cost=0.43..110.52 rows=110 width=0) (actual time=0.107..17.711 rows=3 loops=1)

  • Index Cond: (processed = false)
  • Filter: ((NOT del_rec) AND (NOT processed) AND (action_id = ANY ('{1,2}'::integer[])) AND ((log_event IS NULL) OR ((log_event)::text = ''::text)))
  • Rows Removed by Filter: 614
9. 0.010 1.526 ↑ 1.0 1 1

Aggregate (cost=110.52..110.53 rows=1 width=0) (actual time=1.526..1.526 rows=1 loops=1)

10. 1.516 1.516 ↓ 0.0 0 1

Index Scan using t_messages_processed_idx on t_messages t_messages_2 (cost=0.43..110.52 rows=1 width=0) (actual time=1.516..1.516 rows=0 loops=1)

  • Index Cond: (processed = false)
  • Filter: ((NOT del_rec) AND (NOT processed) AND (action_id = ANY ('{1,2}'::integer[])) AND ((log_event)::text <> ''::text))
  • Rows Removed by Filter: 617
11. 0.113 1.121 ↑ 1.0 1 1

Aggregate (cost=75.75..75.76 rows=1 width=0) (actual time=1.121..1.121 rows=1 loops=1)

12. 1.008 1.008 ↓ 7.4 508 1

Index Scan using t_messages_del_rec_idx on t_messages t_messages_3 (cost=0.43..75.57 rows=69 width=0) (actual time=0.098..1.008 rows=508 loops=1)

  • Index Cond: (del_rec = true)
  • Filter: (del_rec AND (action_id = ANY ('{1,2}'::integer[])))
  • Rows Removed by Filter: 191
Planning time : 1.193 ms
Execution time : 822,118.376 ms