explain.depesz.com

PostgreSQL's explain analyze made readable

Result: y6zj

Settings
# exclusive inclusive rows x rows loops node
1. 23.467 7,081.801 ↑ 175.5 4,245 1

GroupAggregate (cost=76,001,153.21..77,099,750.13 rows=744,846 width=541) (actual time=7,040.319..7,081.801 rows=4,245 loops=1)

  • Group Key: th.id
2.          

CTE contacted_theaters_cte

3. 0.451 10.086 ↑ 6.4 39 1

GroupAggregate (cost=1,625.95..1,685.81 rows=249 width=50) (actual time=9.606..10.086 rows=39 loops=1)

  • Group Key: ct_1.theater_id
4. 0.329 9.635 ↑ 13.9 273 1

Sort (cost=1,625.95..1,635.41 rows=3,783 width=82) (actual time=9.513..9.635 rows=273 loops=1)

  • Sort Key: ct_1.theater_id
  • Sort Method: quicksort Memory: 46kB
5. 0.344 9.306 ↑ 13.9 273 1

Hash Join (cost=85.77..1,401.14 rows=3,783 width=82) (actual time=3.521..9.306 rows=273 loops=1)

  • Hash Cond: (ct_1.user_id = us.id)
6. 5.764 5.764 ↓ 1.0 273 1

Seq Scan on data_recovery_contacted_theaters ct_1 (cost=0.00..1,182.42 rows=267 width=26) (actual time=0.312..5.764 rows=273 loops=1)

  • Filter: ((contacted_date >= '2017-10-20'::date) AND (contacted_date <= '2017-10-26'::date))
  • Rows Removed by Filter: 47822
7. 1.667 3.198 ↑ 1.0 2,834 1

Hash (cost=50.34..50.34 rows=2,834 width=72) (actual time=3.198..3.198 rows=2,834 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 218kB
8. 1.531 1.531 ↑ 1.0 2,834 1

Seq Scan on decrypted_users us (cost=0.00..50.34 rows=2,834 width=72) (actual time=0.009..1.531 rows=2,834 loops=1)

9. 9.351 7,058.334 ↑ 2,014.2 5,240 1

Nested Loop Left Join (cost=75,999,467.40..76,108,741.23 rows=10,554,468 width=279) (actual time=7,040.280..7,058.334 rows=5,240 loops=1)

  • Join Filter: false
10. 6.048 7,048.983 ↑ 2,014.2 5,240 1

Merge Left Join (cost=75,999,467.40..76,003,196.55 rows=10,554,468 width=279) (actual time=7,040.275..7,048.983 rows=5,240 loops=1)

  • Merge Cond: (th.id = mg.theater_id)
11. 8.582 7,038.389 ↑ 143.8 5,179 1

Sort (cost=75,998,977.25..76,000,839.37 rows=744,846 width=203) (actual time=7,035.766..7,038.389 rows=5,179 loops=1)

  • Sort Key: th.id
  • Sort Method: quicksort Memory: 1555kB
12. 6.042 7,029.807 ↑ 143.8 5,179 1

Hash Left Join (cost=74,581,996.22..75,852,497.75 rows=744,846 width=203) (actual time=551.439..7,029.807 rows=5,179 loops=1)

  • Hash Cond: (((th.country_id)::text = (s.country_id)::text) AND ((th.state_id)::text = (s.id)::text))
13. 79.501 7,023.692 ↑ 143.8 5,179 1

Hash Right Join (cost=74,581,993.84..75,841,151.74 rows=744,846 width=194) (actual time=551.304..7,023.692 rows=5,179 loops=1)

  • Hash Cond: (pr.theater_id = th.id)
14. 6,656.678 6,656.678 ↓ 3.5 107,568 1

Seq Scan on theater_properties pr (cost=0.00..1,239,081.95 rows=30,870 width=10) (actual time=261.387..6,656.678 rows=107,568 loops=1)

  • Filter: (as_of_date = '2017-10-20'::date)
  • Rows Removed by Filter: 35631712
15. 5.231 287.513 ↑ 143.8 5,179 1

Hash (cost=74,553,043.27..74,553,043.27 rows=744,846 width=192) (actual time=287.513..287.513 rows=5,179 loops=1)

  • Buckets: 524288 Batches: 2 Memory Usage: 4504kB
16. 4.816 282.282 ↑ 143.8 5,179 1

Merge Left Join (cost=74,543,627.33..74,553,043.27 rows=744,846 width=192) (actual time=239.829..282.282 rows=5,179 loops=1)

  • Merge Cond: (th.id = ct.theater_id)
17. 11.291 267.260 ↑ 143.8 5,179 1

Merge Left Join (cost=74,543,612.44..74,551,164.87 rows=744,846 width=150) (actual time=229.638..267.260 rows=5,179 loops=1)

  • Merge Cond: (th.id = id.theater_id)
18. 7.110 231.891 ↑ 143.8 5,179 1

Merge Left Join (cost=74,537,118.14..74,542,730.03 rows=744,846 width=143) (actual time=211.772..231.891 rows=5,179 loops=1)

  • Merge Cond: (th.id = ta.theater_id)
19. 6.769 209.748 ↑ 155.5 4,791 1

Merge Left Join (cost=74,532,819.21..74,536,564.92 rows=744,846 width=136) (actual time=199.104..209.748 rows=4,791 loops=1)

  • Merge Cond: (th.id = dj.theater_id)
20. 6.224 118.875 ↑ 175.5 4,245 1

Sort (cost=74,515,535.20..74,517,397.32 rows=744,846 width=114) (actual time=116.828..118.875 rows=4,245 loops=1)

  • Sort Key: th.id
  • Sort Method: quicksort Memory: 929kB
21. 4.570 112.651 ↑ 175.5 4,245 1

Hash Left Join (cost=62,171.30..74,397,062.70 rows=744,846 width=114) (actual time=41.763..112.651 rows=4,245 loops=1)

  • Hash Cond: (th.circuit_id = ci.id)
22. 79.911 100.826 ↑ 175.5 4,245 1

Bitmap Heap Scan on theaters th (cost=61,979.47..74,387,468.24 rows=744,846 width=93) (actual time=34.444..100.826 rows=4,245 loops=1)

  • Recheck Cond: ((country_id)::text = 'US'::text)
  • Filter: (alternatives: SubPlan 2 or hashed SubPlan 3)
  • Rows Removed by Filter: 8169
  • Heap Blocks: exact=25651
23. 12.279 12.279 ↑ 12.3 120,664 1

Bitmap Index Scan on ix_theaters_country_49 (cost=0.00..61,793.26 rows=1,489,693 width=0) (actual time=12.279..12.279 rows=120,664 loops=1)

  • Index Cond: ((country_id)::text = 'US'::text)
24.          

SubPlan (for Bitmap Heap Scan)

25. 0.000 0.000 ↓ 0.0 0

Index Scan using ix_theater_aliases_theater_id on theater_aliases ta_1 (cost=0.42..49.44 rows=1 width=0) (never executed)

  • Index Cond: (theater_id = th.id)
  • Filter: ((source_id)::text = ANY ('{AMC,AGILE,ALAMODRAFTHOUSE,ALLURE,AZTECADELRIOBRAVO,BNB,BONNERMALL,CMX,CAPRITHEATRE,CARIBBEANCINEMAS,CENTEREDGE,CINELEO,CINECENTRE,CINEMACOLIBRI,CINEMAPARAMOUNT,CINEMAGIC,CINEMAGIC-USA,CINEMARK,CINEMARK-PERU,CINEMASDELCOUNTRY,CINEMASHENRY,CINEMEX,CINEPLANET,CINEPOLIS,CINEPOLISPERU,CINERAMA,CINESTAR,CITICINEMAS,COBB-IMPORT,EMS,EASYWARE,EXHIBIDORADELBRAVO,FILMBOT,FINO,HARKINS,KWIC,LANDMARK,LIMELIGHT,LOEKS,LOOKCINEMAS,MJR,MALCO,MANUAL-ENTRY,MARCUS,MARQUEE,MAYA,MOVIEHEROES,NCSOFTWARE,NATIONALAMUSEMENTS,OCEANCINEMAS,OMNITERM,OMNITERM-ALT,ORPHEUM,PACIFIC,PACIFIC-VISTA,POHNPEI,RTS,RADIANT,ALT-TAX-RADIANT,RADIANT-HEADQUARTERS,READING,READINGVISTA,REGAL,RETRIEVER,RETRIEVER-AU,RETRIEVER2,SENSIBLE,SOUTHERNTHEATRES,STARLIGHT,STUDIOMOVIEGRILL,SYSTEMBCN,SYUFY,TAPOS,TAPOS-AU,TEXASCINEMAS,THELOT,TITAN,UVK,ULTRASTAR,VEEZI,VENUE,VISTA,WUNDERLANDGAMES}'::text[]))
26. 7.308 8.636 ↑ 1.1 6,535 1

Bitmap Heap Scan on theater_aliases ta_2 (cost=420.97..6,354.36 rows=7,502 width=8) (actual time=1.424..8.636 rows=6,535 loops=1)

  • Recheck Cond: ((source_id)::text = ANY ('{AMC,AGILE,ALAMODRAFTHOUSE,ALLURE,AZTECADELRIOBRAVO,BNB,BONNERMALL,CMX,CAPRITHEATRE,CARIBBEANCINEMAS,CENTEREDGE,CINELEO,CINECENTRE,CINEMACOLIBRI,CINEMAPARAMOUNT,CINEMAGIC,CINEMAGIC-USA,CINEMARK,CINEMARK-PERU,CINEMASDELCOUNTRY,CINEMASHENRY,CINEMEX,CINEPLANET,CINEPOLIS,CINEPOLISPERU,CINERAMA,CINESTAR,CITICINEMAS,COBB-IMPORT,EMS,EASYWARE,EXHIBIDORADELBRAVO,FILMBOT,FINO,HARKINS,KWIC,LANDMARK,LIMELIGHT,LOEKS,LOOKCINEMAS,MJR,MALCO,MANUAL-ENTRY,MARCUS,MARQUEE,MAYA,MOVIEHEROES,NCSOFTWARE,NATIONALAMUSEMENTS,OCEANCINEMAS,OMNITERM,OMNITERM-ALT,ORPHEUM,PACIFIC,PACIFIC-VISTA,POHNPEI,RTS,RADIANT,ALT-TAX-RADIANT,RADIANT-HEADQUARTERS,READING,READINGVISTA,REGAL,RETRIEVER,RETRIEVER-AU,RETRIEVER2,SENSIBLE,SOUTHERNTHEATRES,STARLIGHT,STUDIOMOVIEGRILL,SYSTEMBCN,SYUFY,TAPOS,TAPOS-AU,TEXASCINEMAS,THELOT,TITAN,UVK,ULTRASTAR,VEEZI,VENUE,VISTA,WUNDERLANDGAMES}'::text[]))
  • Heap Blocks: exact=1000
27. 1.328 1.328 ↑ 1.1 6,537 1

Bitmap Index Scan on ix_theater_aliases_source_id (cost=0.00..419.09 rows=7,502 width=0) (actual time=1.328..1.328 rows=6,537 loops=1)

  • Index Cond: ((source_id)::text = ANY ('{AMC,AGILE,ALAMODRAFTHOUSE,ALLURE,AZTECADELRIOBRAVO,BNB,BONNERMALL,CMX,CAPRITHEATRE,CARIBBEANCINEMAS,CENTEREDGE,CINELEO,CINECENTRE,CINEMACOLIBRI,CINEMAPARAMOUNT,CINEMAGIC,CINEMAGIC-USA,CINEMARK,CINEMARK-PERU,CINEMASDELCOUNTRY,CINEMASHENRY,CINEMEX,CINEPLANET,CINEPOLIS,CINEPOLISPERU,CINERAMA,CINESTAR,CITICINEMAS,COBB-IMPORT,EMS,EASYWARE,EXHIBIDORADELBRAVO,FILMBOT,FINO,HARKINS,KWIC,LANDMARK,LIMELIGHT,LOEKS,LOOKCINEMAS,MJR,MALCO,MANUAL-ENTRY,MARCUS,MARQUEE,MAYA,MOVIEHEROES,NCSOFTWARE,NATIONALAMUSEMENTS,OCEANCINEMAS,OMNITERM,OMNITERM-ALT,ORPHEUM,PACIFIC,PACIFIC-VISTA,POHNPEI,RTS,RADIANT,ALT-TAX-RADIANT,RADIANT-HEADQUARTERS,READING,READINGVISTA,REGAL,RETRIEVER,RETRIEVER-AU,RETRIEVER2,SENSIBLE,SOUTHERNTHEATRES,STARLIGHT,STUDIOMOVIEGRILL,SYSTEMBCN,SYUFY,TAPOS,TAPOS-AU,TEXASCINEMAS,THELOT,TITAN,UVK,ULTRASTAR,VEEZI,VENUE,VISTA,WUNDERLANDGAMES}'::text[]))
28. 3.699 7.255 ↑ 1.0 6,259 1

Hash (cost=113.59..113.59 rows=6,259 width=29) (actual time=7.255..7.255 rows=6,259 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 445kB
29. 3.556 3.556 ↑ 1.0 6,259 1

Seq Scan on circuits ci (cost=0.00..113.59 rows=6,259 width=29) (actual time=0.016..3.556 rows=6,259 loops=1)

30. 4.436 84.104 ↓ 1.0 4,013 1

Sort (cost=17,284.00..17,293.61 rows=3,844 width=30) (actual time=82.270..84.104 rows=4,013 loops=1)

  • Sort Key: dj.theater_id
  • Sort Method: quicksort Memory: 411kB
31. 4.151 79.668 ↓ 1.0 4,013 1

Hash Left Join (cost=1.99..17,055.12 rows=3,844 width=30) (actual time=18.393..79.668 rows=4,013 loops=1)

  • Hash Cond: (dj.justification_id = (ju.id)::text)
32. 75.462 75.462 ↓ 1.0 4,013 1

Seq Scan on data_recovery_justifications dj (cost=0.00..17,005.38 rows=3,844 width=14) (actual time=18.325..75.462 rows=4,013 loops=1)

  • Filter: ((booking_date >= '2017-10-20'::date) AND (booking_date <= '2017-10-26'::date))
  • Rows Removed by Filter: 784709
33. 0.027 0.055 ↑ 1.0 44 1

Hash (cost=1.44..1.44 rows=44 width=18) (actual time=0.055..0.055 rows=44 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
34. 0.028 0.028 ↑ 1.0 44 1

Seq Scan on justifications ju (cost=0.00..1.44 rows=44 width=18) (actual time=0.005..0.028 rows=44 loops=1)

35. 5.991 15.033 ↓ 7.5 5,501 1

Sort (cost=4,298.92..4,300.75 rows=731 width=15) (actual time=12.663..15.033 rows=5,501 loops=1)

  • Sort Key: ta.theater_id
  • Sort Method: quicksort Memory: 518kB
36. 4.332 9.042 ↓ 8.2 6,018 1

Bitmap Heap Scan on theater_aliases ta (cost=2,222.25..4,264.15 rows=731 width=15) (actual time=4.804..9.042 rows=6,018 loops=1)

  • Recheck Cond: (((source_id)::text = ANY ('{AMC,AGILE,ALAMODRAFTHOUSE,ALLURE,AZTECADELRIOBRAVO,BNB,BONNERMALL,CMX,CAPRITHEATRE,CARIBBEANCINEMAS,CENTEREDGE,CINELEO,CINECENTRE,CINEMACOLIBRI,CINEMAPARAMOUNT,CINEMAGIC,CINEMAGIC-USA,CINEMARK,CINEMARK-PERU,CINEMASDELCOUNTRY,CINEMASHENRY,CINEMEX,CINEPLANET,CINEPOLIS,CINEPOLISPERU,CINERAMA,CINESTAR,CITICINEMAS,COBB-IMPORT,EMS,EASYWARE,EXHIBIDORADELBRAVO,FILMBOT,FINO,HARKINS,KWIC,LANDMARK,LIMELIGHT,LOEKS,LOOKCINEMAS,MJR,MALCO,MANUAL-ENTRY,MARCUS,MARQUEE,MAYA,MOVIEHEROES,NCSOFTWARE,NATIONALAMUSEMENTS,OCEANCINEMAS,OMNITERM,OMNITERM-ALT,ORPHEUM,PACIFIC,PACIFIC-VISTA,POHNPEI,RTS,RADIANT,ALT-TAX-RADIANT,RADIANT-HEADQUARTERS,READING,READINGVISTA,REGAL,RETRIEVER,RETRIEVER-AU,RETRIEVER2,SENSIBLE,SOUTHERNTHEATRES,STARLIGHT,STUDIOMOVIEGRILL,SYSTEMBCN,SYUFY,TAPOS,TAPOS-AU,TEXASCINEMAS,THELOT,TITAN,UVK,ULTRASTAR,VEEZI,VENUE,VISTA,WUNDERLANDGAMES}'::text[])) AND (source_type = 'EXT'::text))
  • Heap Blocks: exact=955
37. 0.041 4.710 ↓ 0.0 0 1

BitmapAnd (cost=2,222.25..2,222.25 rows=731 width=0) (actual time=4.710..4.710 rows=0 loops=1)

38. 0.968 0.968 ↑ 1.1 6,537 1

Bitmap Index Scan on ix_theater_aliases_source_id (cost=0.00..419.09 rows=7,502 width=0) (actual time=0.968..0.968 rows=6,537 loops=1)

  • Index Cond: ((source_id)::text = ANY ('{AMC,AGILE,ALAMODRAFTHOUSE,ALLURE,AZTECADELRIOBRAVO,BNB,BONNERMALL,CMX,CAPRITHEATRE,CARIBBEANCINEMAS,CENTEREDGE,CINELEO,CINECENTRE,CINEMACOLIBRI,CINEMAPARAMOUNT,CINEMAGIC,CINEMAGIC-USA,CINEMARK,CINEMARK-PERU,CINEMASDELCOUNTRY,CINEMASHENRY,CINEMEX,CINEPLANET,CINEPOLIS,CINEPOLISPERU,CINERAMA,CINESTAR,CITICINEMAS,COBB-IMPORT,EMS,EASYWARE,EXHIBIDORADELBRAVO,FILMBOT,FINO,HARKINS,KWIC,LANDMARK,LIMELIGHT,LOEKS,LOOKCINEMAS,MJR,MALCO,MANUAL-ENTRY,MARCUS,MARQUEE,MAYA,MOVIEHEROES,NCSOFTWARE,NATIONALAMUSEMENTS,OCEANCINEMAS,OMNITERM,OMNITERM-ALT,ORPHEUM,PACIFIC,PACIFIC-VISTA,POHNPEI,RTS,RADIANT,ALT-TAX-RADIANT,RADIANT-HEADQUARTERS,READING,READINGVISTA,REGAL,RETRIEVER,RETRIEVER-AU,RETRIEVER2,SENSIBLE,SOUTHERNTHEATRES,STARLIGHT,STUDIOMOVIEGRILL,SYSTEMBCN,SYUFY,TAPOS,TAPOS-AU,TEXASCINEMAS,THELOT,TITAN,UVK,ULTRASTAR,VEEZI,VENUE,VISTA,WUNDERLANDGAMES}'::text[]))
39. 3.701 3.701 ↑ 1.0 35,309 1

Bitmap Index Scan on ix_theater_aliases_source_type (cost=0.00..1,802.54 rows=35,482 width=0) (actual time=3.701..3.701 rows=35,309 loops=1)

  • Index Cond: (source_type = 'EXT'::text)
40. 15.206 24.078 ↓ 1.0 14,783 1

Sort (cost=6,494.26..6,529.52 rows=14,106 width=15) (actual time=17.862..24.078 rows=14,783 loops=1)

  • Sort Key: id.theater_id
  • Sort Method: quicksort Memory: 1034kB
41. 8.138 8.872 ↑ 1.0 13,860 1

Bitmap Heap Scan on theater_aliases id (cost=485.74..5,522.07 rows=14,106 width=15) (actual time=0.774..8.872 rows=13,860 loops=1)

  • Recheck Cond: ((source_id)::text = 'BOE'::text)
  • Heap Blocks: exact=381
42. 0.734 0.734 ↑ 1.0 13,860 1

Bitmap Index Scan on ix_theater_aliases_source_id (cost=0.00..482.22 rows=14,106 width=0) (actual time=0.734..0.734 rows=13,860 loops=1)

  • Index Cond: ((source_id)::text = 'BOE'::text)
43. 0.044 10.206 ↑ 5.4 46 1

Sort (cost=14.89..15.51 rows=249 width=50) (actual time=10.187..10.206 rows=46 loops=1)

  • Sort Key: ct.theater_id
  • Sort Method: quicksort Memory: 28kB
44. 10.162 10.162 ↑ 6.4 39 1

CTE Scan on contacted_theaters_cte ct (cost=0.00..4.98 rows=249 width=50) (actual time=9.610..10.162 rows=39 loops=1)

45. 0.041 0.073 ↑ 1.0 50 1

Hash (cost=1.62..1.62 rows=50 width=15) (actual time=0.073..0.073 rows=50 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
46. 0.032 0.032 ↑ 1.0 50 1

Seq Scan on states s (cost=0.00..1.62 rows=50 width=15) (actual time=0.008..0.032 rows=50 loops=1)

  • Filter: ((country_id)::text = 'US'::text)
47. 0.130 4.546 ↑ 8.4 105 1

Sort (cost=490.15..492.35 rows=879 width=84) (actual time=4.502..4.546 rows=105 loops=1)

  • Sort Key: mg.theater_id
  • Sort Method: quicksort Memory: 31kB
48. 0.065 4.416 ↑ 16.6 53 1

Hash Left Join (cost=85.77..447.17 rows=879 width=84) (actual time=3.812..4.416 rows=53 loops=1)

  • Hash Cond: (mg.user_id = nu.id)
49. 1.400 1.400 ↑ 1.2 53 1

Seq Scan on data_recovery_mg_ignored_dates mg (cost=0.00..330.52 rows=62 width=28) (actual time=0.844..1.400 rows=53 loops=1)

  • Filter: ((ignored_date >= '2017-10-20'::date) AND (ignored_date <= '2017-10-26'::date))
  • Rows Removed by Filter: 13382
50. 1.511 2.951 ↑ 1.0 2,834 1

Hash (cost=50.34..50.34 rows=2,834 width=72) (actual time=2.951..2.951 rows=2,834 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 218kB
51. 1.440 1.440 ↑ 1.0 2,834 1

Seq Scan on decrypted_users nu (cost=0.00..50.34 rows=2,834 width=72) (actual time=0.010..1.440 rows=2,834 loops=1)

52. 0.000 0.000 ↓ 0.0 0 5,240

Result (cost=0.00..0.00 rows=0 width=0) (actual time=0.000..0.000 rows=0 loops=5,240)

  • One-Time Filter: false