explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kPAZ

Settings
# exclusive inclusive rows x rows loops node
1. 495.675 137,490.514 ↓ 38.6 206,955 1

HashAggregate (cost=2,009,193.96..2,009,247.64 rows=5,368 width=32) (actual time=137,433.780..137,490.514 rows=206,955 loops=1)

  • Group Key: delo.delo_id
2. 19.686 136,994.839 ↓ 40.5 217,142 1

Append (cost=1,000.57..2,009,180.54 rows=5,368 width=32) (actual time=28.263..136,994.839 rows=217,142 loops=1)

3. 0.000 42,295.742 ↓ 33.2 178,051 1

Gather (cost=1,000.57..1,376,908.36 rows=5,363 width=6) (actual time=28.262..42,295.742 rows=178,051 loops=1)

  • Workers Planned: 6
  • Workers Launched: 3
4. 52.655 42,543.274 ↓ 49.8 44,513 4 / 4

Nested Loop Anti Join (cost=0.57..1,375,372.06 rows=894 width=6) (actual time=14.899..42,543.274 rows=44,513 loops=4)

5. 17,573.574 17,573.574 ↓ 59.7 54,286 4 / 4

Parallel Seq Scan on delo (cost=0.00..1,373,749.80 rows=909 width=6) (actual time=10.045..17,573.574 rows=54,286 loops=4)

  • Filter: (((ogai_nah_kod)::text = '45597'::text) AND (stad_delo_kod = ANY ('{3,4,5}'::numeric[])) AND ((date_part('year'::text, delo_dat))::numeric = (date_part('year'::text, ((('now'::cstring)::date - '1 year'::interval) - '2 mons'::interval)))::numeric))
  • Rows Removed by Filter: 3,787,933
6. 24,917.044 24,917.044 ↓ 0.0 0 217,142 / 4

Index Only Scan using delo_tags_tag_uniq on delo_tags tag (cost=0.57..1.78 rows=1 width=6) (actual time=0.459..0.459 rows=0 loops=217,142)

  • Index Cond: ((card_id = delo.delo_id) AND (card_category = '1'::numeric) AND (type_id = '8'::numeric))
  • Heap Fetches: 0
7. 24.207 94,679.411 ↓ 7,818.2 39,091 1

Nested Loop Semi Join (cost=203,451.52..632,218.50 rows=5 width=7) (actual time=65,287.287..94,679.411 rows=39,091 loops=1)

8. 27,529.756 92,708.948 ↓ 164.2 49,904 1

Bitmap Heap Scan on delo delo_1 (cost=203,450.95..631,673.09 rows=304 width=13) (actual time=65,263.253..92,708.948 rows=49,904 loops=1)

  • Recheck Cond: ((delo_main_id IS NOT NULL) AND ((ogai_nah_kod)::text = '45597'::text))
  • Rows Removed by Index Recheck: 4,786,222
  • Filter: ((stad_delo_kod = ANY ('{3,4,5}'::numeric[])) AND ((date_part('year'::text, delo_dat))::numeric = (date_part('year'::text, ((('now'::cstring)::date - '1 year'::interval) - '2 mons'::interval)))::numeric))
  • Rows Removed by Filter: 246,556
  • Heap Blocks: exact=46,304 lossy=413,184
9. 31.530 65,179.192 ↓ 0.0 0 1

BitmapAnd (cost=203,450.95..203,450.95 rows=442,009 width=0) (actual time=65,179.192..65,179.192 rows=0 loops=1)

10. 1,799.733 1,799.733 ↓ 1.1 915,744 1

Bitmap Index Scan on delo_delo_main_id (cost=0.00..14,831.48 rows=852,532 width=0) (actual time=1,799.733..1,799.733 rows=915,744 loops=1)

11. 63,347.929 63,347.929 ↓ 1.0 8,121,629 1

Bitmap Index Scan on delo_delo_dat_desc (cost=0.00..188,619.07 rows=7,935,534 width=0) (actual time=63,347.929..63,347.929 rows=8,121,629 loops=1)

  • Index Cond: ((ogai_nah_kod)::text = '45597'::text)
12. 1,946.256 1,946.256 ↑ 1.0 1 49,904

Index Only Scan using delo_tags_tag_uniq on delo_tags tag_1 (cost=0.57..1.79 rows=1 width=6) (actual time=0.039..0.039 rows=1 loops=49,904)

  • Index Cond: ((card_id = delo_1.delo_id) AND (card_category = '1'::numeric) AND (type_id = '8'::numeric))
  • Heap Fetches: 0
Planning time : 0.853 ms
Execution time : 137,499.248 ms