explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 74hO

Settings
# exclusive inclusive rows x rows loops node
1. 0.050 4,804.282 ↑ 60.9 20 1

Sort (cost=441,092.15..441,095.19 rows=1,217 width=285) (actual time=4,804.278..4,804.282 rows=20 loops=1)

  • Sort Key: (count(CASE WHEN ((vpm.current_state)::text = 'started'::text) THEN vpm.id ELSE NULL::integer END)) DESC
  • Sort Method: quicksort Memory: 45kB
2. 15.871 4,804.232 ↑ 60.9 20 1

GroupAggregate (cost=440,813.77..441,029.79 rows=1,217 width=285) (actual time=4,784.023..4,804.232 rows=20 loops=1)

  • Group Key: voice_mission.id, subq.unallocated_call_contact, subq.number_of_call_contacts_in_reschedule, subq.pickable
3. 18.553 4,788.361 ↓ 19.2 23,406 1

Sort (cost=440,813.77..440,816.81 rows=1,217 width=66) (actual time=4,783.161..4,788.361 rows=23,406 loops=1)

  • Sort Key: voice_mission.id, subq.unallocated_call_contact, subq.number_of_call_contacts_in_reschedule, subq.pickable
  • Sort Method: quicksort Memory: 4060kB
4. 13.287 4,769.808 ↓ 19.2 23,406 1

Hash Join (cost=106,484.59..440,751.40 rows=1,217 width=66) (actual time=4,599.870..4,769.808 rows=23,406 loops=1)

  • Hash Cond: (vpm.voice_mission_id = voice_mission.id)
5. 0.003 4,406.846 ↓ 6.2 23,406 1

Gather (cost=77,124.32..411,364.73 rows=3,798 width=17) (actual time=4,250.179..4,406.846 rows=23,406 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 179.006 4,406.843 ↓ 4.9 7,802 3

Parallel Bitmap Heap Scan on voice_core_voiceplayermission vpm (cost=76,124.32..409,984.93 rows=1,582 width=17) (actual time=4,247.207..4,406.843 rows=7,802 loops=3)

  • Recheck Cond: (voice_mission_id = ANY ('{1795,1776,1774,1765,1763,1755,1413,1744,1743,1742,1717,1727,1712,1710,1711,1685,1702,1701,1688,1680,1338,1339,924,1384,1435,1388,1418,1414,1367,1507,1546,1464,1271,1273,1549,1507,1413,1577,1579,1681,1515,1601,1619,1620,1631,1630,1638,1639,1636,1656,1657,1673,1675,1413}'::integer[]))
  • Filter: (((created_at + '05:30:00'::interval) >= '2019-09-08 00:00:00+00'::timestamp with time zone) AND ((created_at + '05:30:00'::interval) <= '2019-09-10 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 250871
  • Heap Blocks: exact=32270
7. 4,227.837 4,227.837 ↓ 1.0 776,018 1

Bitmap Index Scan on voice_core_voiceplayermission_f89f2fdf (cost=0.00..76,123.38 rows=759,596 width=0) (actual time=4,227.837..4,227.837 rows=776,018 loops=1)

  • Index Cond: (voice_mission_id = ANY ('{1795,1776,1774,1765,1763,1755,1413,1744,1743,1742,1717,1727,1712,1710,1711,1685,1702,1701,1688,1680,1338,1339,924,1384,1435,1388,1418,1414,1367,1507,1546,1464,1271,1273,1549,1507,1413,1577,1579,1681,1515,1601,1619,1620,1631,1630,1638,1639,1636,1656,1657,1673,1675,1413}'::integer[]))
8. 0.046 349.675 ↑ 7.1 80 1

Hash (cost=29,353.17..29,353.17 rows=567 width=57) (actual time=349.675..349.675 rows=80 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
9. 0.424 349.629 ↑ 7.1 80 1

Hash Join (cost=29,165.83..29,353.17 rows=567 width=57) (actual time=348.521..349.629 rows=80 loops=1)

  • Hash Cond: (voice_mission.id = subq.voice_mission_id)
10. 0.793 0.793 ↓ 1.0 1,770 1

Seq Scan on voice_core_voicemission voice_mission (cost=0.00..182.69 rows=1,769 width=29) (actual time=0.006..0.793 rows=1,770 loops=1)

11. 0.036 348.412 ↑ 7.1 80 1

Hash (cost=29,158.74..29,158.74 rows=567 width=28) (actual time=348.411..348.412 rows=80 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
12. 0.034 348.376 ↑ 7.1 80 1

Subquery Scan on subq (cost=29,147.40..29,158.74 rows=567 width=28) (actual time=348.313..348.376 rows=80 loops=1)

13. 20.061 348.342 ↑ 7.1 80 1

HashAggregate (cost=29,147.40..29,153.07 rows=567 width=28) (actual time=348.312..348.342 rows=80 loops=1)

  • Group Key: call_contact.voice_mission_id
14. 25.241 328.281 ↓ 1.3 50,320 1

Hash Join (cost=205.24..28,546.02 rows=40,092 width=22) (actual time=1.184..328.281 rows=50,320 loops=1)

  • Hash Cond: (call_contact.voice_mission_id = inner_voice_mission.id)
15. 301.896 301.896 ↓ 1.3 50,320 1

Index Scan using voice_core_callcontact_updated_at on voice_core_callcontact call_contact (cost=0.43..28,235.72 rows=40,092 width=22) (actual time=0.027..301.896 rows=50,320 loops=1)

  • Index Cond: (updated_at > '2019-09-08 00:00:00+00'::timestamp with time zone)
16. 0.500 1.144 ↓ 1.0 1,770 1

Hash (cost=182.69..182.69 rows=1,769 width=4) (actual time=1.144..1.144 rows=1,770 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
17. 0.644 0.644 ↓ 1.0 1,770 1

Seq Scan on voice_core_voicemission inner_voice_mission (cost=0.00..182.69 rows=1,769 width=4) (actual time=0.001..0.644 rows=1,770 loops=1)

Planning time : 2.340 ms
Execution time : 4,806.374 ms