explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l0dR

Settings
# exclusive inclusive rows x rows loops node
1. 5,162.699 66,860.733 ↑ 336.4 1,898 1

GroupAggregate (cost=2,364,527.53..2,568,873.10 rows=638,580 width=90) (actual time=53,349.070..66,860.733 rows=1,898 loops=1)

  • Group Key: (date((p.date - '05:00:00'::interval))), p.processor_id, (CASE WHEN ((p.order_capability)::text = ANY ('{mobile_app_2,mobile_app_2_cc_validator}'::text[])) THEN 'Android'::text WHEN ((p.order_capability)::text = 'mobile_app_3'::text) THEN 'iOS'::text WHEN ((p.order_capability)::text = 'mobile_app_sms'::text) THEN 'SMS'::text WHEN ((p.order_capability)::text = 'mobile_web'::text) THEN 'Mobile Web'::text WHEN (p.order_capability IS NULL) THEN 'undefined'::text ELSE initcap(replace(replace((p.order_capability)::text, '_'::text, ' '::text), '-'::text, ' '::text)) END)
2. 26,012.144 61,698.034 ↓ 1.3 8,209,766 1

Sort (cost=2,364,527.53..2,380,492.03 rows=6,385,799 width=50) (actual time=53,340.739..61,698.034 rows=8,209,766 loops=1)

  • Sort Key: (date((p.date - '05:00:00'::interval))), p.processor_id, (CASE WHEN ((p.order_capability)::text = ANY ('{mobile_app_2,mobile_app_2_cc_validator}'::text[])) THEN 'Android'::text WHEN ((p.order_capability)::text = 'mobile_app_3'::text) THEN 'iOS'::text WHEN ((p.order_capability)::text = 'mobile_app_sms'::text) THEN 'SMS'::text WHEN ((p.order_capability)::text = 'mobile_web'::text) THEN 'Mobile Web'::text WHEN (p.order_capability IS NULL) THEN 'undefined'::text ELSE initcap(replace(replace((p.order_capability)::text, '_'::text, ' '::text), '-'::text, ' '::text)) END)
  • Sort Method: external merge Disk: 328928kB
3. 8,541.573 35,685.890 ↓ 1.3 8,209,766 1

Result (cost=0.00..1,206,192.76 rows=6,385,799 width=50) (actual time=2.370..35,685.890 rows=8,209,766 loops=1)

4. 3,494.382 27,144.317 ↓ 1.3 8,209,766 1

Append (cost=0.00..998,654.29 rows=6,385,799 width=37) (actual time=2.300..27,144.317 rows=8,209,766 loops=1)

5. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on payments_log p (cost=0.00..0.00 rows=1 width=1,158) (actual time=0.003..0.004 rows=0 loops=1)

  • Filter: (processor_processed AND (date > '2020-01-06 00:00:00+00'::timestamp with time zone) AND ((action)::text = 'authorize'::text))
6. 19,631.725 19,631.725 ↓ 1.3 6,718,018 1

Seq Scan on payments_log_2020_01 p_1 (cost=0.00..844,501.28 rows=5,093,981 width=37) (actual time=2.296..19,631.725 rows=6,718,018 loops=1)

  • Filter: (processor_processed AND (date > '2020-01-06 00:00:00+00'::timestamp with time zone) AND ((action)::text = 'authorize'::text))
  • Rows Removed by Filter: 12005607
7. 4,018.206 4,018.206 ↓ 1.2 1,491,748 1

Seq Scan on payments_log_2020_02 p_2 (cost=0.00..154,153.01 rows=1,291,817 width=37) (actual time=0.502..4,018.206 rows=1,491,748 loops=1)

  • Filter: (processor_processed AND (date > '2020-01-06 00:00:00+00'::timestamp with time zone) AND ((action)::text = 'authorize'::text))
  • Rows Removed by Filter: 1677738
Planning time : 752.400 ms
Execution time : 66,907.828 ms