explain.depesz.com

A tool for finding a real cause for slow queries.

Result: ez7

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.001 9107.546 ↓ 0.0 0 1

GroupAggregate (cost=15702.97..15702.99 rows=1 width=16) (actual time=9107.546..9107.546 rows=0 loops=1)

2. 0.007 9107.545 ↓ 0.0 0 1

Sort (cost=15702.97..15702.97 rows=1 width=16) (actual time=9107.545..9107.545 rows=0 loops=1)

  • Sort Key: tgm1.position_in_group, tgmt.test_target_id
  • Sort Method: quicksort Memory: 25kB
3. 0.000 9107.538 ↓ 0.0 0 1

Nested Loop (cost=11005.42..15702.96 rows=1 width=16) (actual time=9107.538..9107.538 rows=0 loops=1)

  • Join Filter: (tg1.id <> tg.id)
4. 1.041 9107.538 ↓ 0.0 0 1

Nested Loop (cost=11005.42..15696.68 rows=1 width=36) (actual time=9107.538..9107.538 rows=0 loops=1)

5. 219.049 8969.297 ↓ 2450.0 2450 1

Nested Loop (cost=11005.42..15690.35 rows=1 width=32) (actual time=3450.742..8969.297 rows=2450 loops=1)

6. 180.114 7787.287 ↓ 320987.0 320987 1

Nested Loop (cost=11005.42..15689.94 rows=1 width=40) (actual time=3425.513..7787.287 rows=320987 loops=1)

7. 127.521 6329.101 ↓ 319518.0 319518 1

Nested Loop (cost=11005.42..15689.12 rows=1 width=28) (actual time=3425.483..6329.101 rows=319518 loops=1)

8. 206.231 4758.828 ↓ 186.1 360688 1

Hash Join (cost=11005.42..14564.14 rows=1938 width=36) (actual time=3425.466..4758.828 rows=360688 loops=1)

  • Hash Cond: (tgm.test_group_id = tg.id)
9. 1108.991 4551.553 ↓ 57.2 380517 1

Hash Join (cost=10929.65..14444.03 rows=6655 width=32) (actual time=3424.411..4551.553 rows=380517 loops=1)

  • Hash Cond: (tgm.record_id = sbb.id)
10. 18.509 26.265 ↓ 1.0 51759 1

Bitmap Heap Scan on test_group_member tgm (cost=1443.26..4698.86 rows=51263 width=24) (actual time=7.975..26.265 rows=51759 loops=1)

  • Recheck Cond: ((table_name)::text = 'sentinel_band_bleed'::text)
  • Filter: (deactive_date IS NULL)
11. 7.756 7.756 ↓ 1.0 51899 1

Bitmap Index Scan on test_group_member_table_name_record_id_btree (cost=0.00..1430.45 rows=51488 width=0) (actual time=7.756..7.756 rows=51899 loops=1)

  • Index Cond: ((table_name)::text = 'sentinel_band_bleed'::text)
12. 1141.006 3416.297 ↓ 54.0 1941368 1

Hash (cost=9037.17..9037.17 rows=35937 width=24) (actual time=3416.297..3416.297 rows=1941368 loops=1)

  • Buckets: 4096 Batches: 4 (originally 1) Memory Usage: 32769kB
13. 739.706 2275.291 ↓ 54.0 1941368 1

Nested Loop (cost=1100.34..9037.17 rows=35937 width=24) (actual time=26.825..2275.291 rows=1941368 loops=1)

14. 303.775 348.385 ↓ 53.0 237440 1

Hash Join (cost=1100.34..4943.56 rows=4477 width=16) (actual time=26.803..348.385 rows=237440 loops=1)

  • Hash Cond: ((sfb.sentinel_flock_id = sfb1.sentinel_flock_id) AND (sfb.agency_id = sfb1.agency_id))
  • Join Filter: ((sfb1.id <> sfb.id) AND (sfb.collection_date <= sfb1.collection_date))
15. 17.860 17.860 ↓ 1.0 28386 1

Seq Scan on sentinel_flock_bleed sfb (cost=0.00..688.21 rows=27475 width=28) (actual time=0.011..17.860 rows=28386 loops=1)

  • Filter: ((deactive_date IS NULL) AND (read_only_bit IS TRUE) AND (worksheet_bit IS FALSE))
16. 11.405 26.750 ↓ 1.0 28386 1

Hash (cost=688.21..688.21 rows=27475 width=28) (actual time=26.750..26.750 rows=28386 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1664kB
17. 15.345 15.345 ↓ 1.0 28386 1

Seq Scan on sentinel_flock_bleed sfb1 (cost=0.00..688.21 rows=27475 width=28) (actual time=0.005..15.345 rows=28386 loops=1)

  • Filter: ((deactive_date IS NULL) AND (read_only_bit IS TRUE) AND (worksheet_bit IS FALSE))
18. 1187.200 1187.200 ↑ 1.1 8 237440

Index Scan using sentinel_band_bleed_sentinel_flock_bleed_id_key on sentinel_band_bleed sbb (cost=0.00..0.80 rows=9 width=24) (actual time=0.003..0.005 rows=8 loops=237440)

  • Index Cond: ((sbb.sentinel_flock_bleed_id = sfb.id) AND (sbb.deactive_date IS NULL))
19. 0.308 1.044 ↓ 1.1 841 1

Hash (cost=66.59..66.59 rows=735 width=12) (actual time=1.044..1.044 rows=841 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 37kB
20. 0.736 0.736 ↓ 1.1 841 1

Index Scan using test_group_agency_id_btree on test_group tg (cost=0.00..66.59 rows=735 width=12) (actual time=0.026..0.736 rows=841 loops=1)

  • Index Cond: (agency_id = 77)
  • Filter: ((run_date IS NOT NULL) AND (run_by IS NOT NULL) AND (run_date_complete IS NOT NULL) AND (deactive_date IS NULL))
21. 1442.752 1442.752 ↑ 1.0 1 360688

Index Scan using sentinel_band_bleed_sentinel_flock_bleed_id_key on sentinel_band_bleed sbb1 (cost=0.00..0.57 rows=1 width=24) (actual time=0.003..0.004 rows=1 loops=360688)

  • Index Cond: ((sbb1.sentinel_flock_bleed_id = sfb1.id) AND (sbb1.sentinel_band_id = sbb.sentinel_band_id) AND (sbb1.deactive_date IS NULL))
22. 1278.072 1278.072 ↑ 1.0 1 319518

Index Scan using test_group_member_target_test_group_member_id_key on test_group_member_target tgmt (cost=0.00..0.80 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=319518)

  • Index Cond: ((tgmt.test_group_member_id = tgm.id) AND (tgmt.deactive_date IS NULL))
  • Filter: (tgmt.test_target_id = ANY ('{4,6,7}'::integer[]))
23. 962.961 962.961 ↓ 0.0 0 320987

Index Scan using test_group_member_target_result_test_group_member_target_id_key on test_group_member_target_result tgmtr (cost=0.00..0.40 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=320987)

  • Index Cond: ((tgmtr.test_group_member_target_id = tgmt.id) AND (tgmtr.deactive_date IS NULL))
  • Filter: (tgmtr.test_status_id = 3)
24. 137.200 137.200 ↓ 0.0 0 2450

Index Scan using test_group_member_table_name_record_id_btree on test_group_member tgm1 (cost=0.00..6.31 rows=1 width=20) (actual time=0.056..0.056 rows=0 loops=2450)

  • Index Cond: (((tgm1.table_name)::text = 'sentinel_band_bleed'::text) AND (tgm1.record_id = sbb1.id))
  • Filter: ((tgm1.deactive_date IS NULL) AND (tgm1.name IS NULL) AND (tgm1.test_group_id = 2687))
25. 0.000 0.000 ↓ 0.0 0

Index Scan using test_group_pkey on test_group tg1 (cost=0.00..6.27 rows=1 width=12) (actual time=.. rows= loops=0)

  • Index Cond: (tg1.id = 2687)
  • Filter: ((tg1.deactive_date IS NULL) AND (tg1.agency_id = 77))