explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CWj8

Settings
# exclusive inclusive rows x rows loops node
1. 6.612 3,704.985 ↓ 1.4 227 1

Nested Loop Left Join (cost=12,887.62..613,344.68 rows=163 width=1,770) (actual time=68.330..3,704.985 rows=227 loops=1)

2. 0.474 80.901 ↓ 1.4 227 1

Hash Left Join (cost=9,223.70..16,091.74 rows=163 width=1,354) (actual time=52.737..80.901 rows=227 loops=1)

  • Hash Cond: ((sellers.referral)::text = (i.id)::text)
3. 0.728 80.355 ↓ 1.4 227 1

Nested Loop (cost=9,213.65..16,081.25 rows=163 width=1,329) (actual time=52.656..80.355 rows=227 loops=1)

4. 0.461 77.584 ↓ 1.4 227 1

Hash Left Join (cost=9,213.37..15,986.93 rows=163 width=540) (actual time=52.638..77.584 rows=227 loops=1)

  • Hash Cond: ((bids.aste_id)::text = (bids_1.aste_id)::text)
5. 0.527 72.725 ↓ 1.4 227 1

Hash Left Join (cost=8,800.63..15,573.76 rows=163 width=573) (actual time=48.200..72.725 rows=227 loops=1)

  • Hash Cond: ((bids.buyers_id)::text = (buyers.id)::text)
6. 0.477 72.127 ↓ 1.4 227 1

Hash Left Join (cost=8,792.91..15,565.60 rows=163 width=549) (actual time=48.123..72.127 rows=227 loops=1)

  • Hash Cond: ((aste.winning_bid)::text = (operazioni_2.bids_id)::text)
7. 0.473 66.372 ↓ 1.4 227 1

Hash Join (cost=7,425.88..14,194.79 rows=163 width=549) (actual time=42.805..66.372 rows=227 loops=1)

  • Hash Cond: ((sellers.id)::text = (debtors.sellers_id)::text)
8. 0.859 60.302 ↑ 1.0 227 1

Nested Loop (cost=6,710.61..13,437.02 rows=227 width=590) (actual time=37.193..60.302 rows=227 loops=1)

9. 0.583 57.627 ↑ 1.0 227 1

Hash Join (cost=6,710.33..13,342.68 rows=227 width=507) (actual time=37.181..57.627 rows=227 loops=1)

  • Hash Cond: ((aste.fatture_id)::text = (fatture.id)::text)
10. 0.653 51.201 ↑ 1.0 227 1

Nested Loop Left Join (cost=6,284.89..12,916.65 rows=227 width=324) (actual time=31.295..51.201 rows=227 loops=1)

11. 1.296 37.155 ↑ 1.0 227 1

Hash Right Join (cost=6,261.43..7,585.68 rows=227 width=316) (actual time=31.244..37.155 rows=227 loops=1)

  • Hash Cond: ((operazioni.bids_id)::text = (aste.winning_bid)::text)
12. 5.568 5.568 ↑ 1.0 5,096 1

Seq Scan on operazioni (cost=0.00..1,303.55 rows=5,096 width=75) (actual time=0.014..5.568 rows=5,096 loops=1)

  • Filter: ((type)::text = 'BA'::text)
  • Rows Removed by Filter: 21428
13. 0.171 30.291 ↑ 1.0 227 1

Hash (cost=6,258.59..6,258.59 rows=227 width=282) (actual time=30.290..30.291 rows=227 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 79kB
14. 0.594 30.120 ↑ 1.0 227 1

Hash Right Join (cost=4,934.41..6,258.59 rows=227 width=282) (actual time=25.909..30.120 rows=227 loops=1)

  • Hash Cond: ((operazioni_1.bids_id)::text = (aste.winning_bid)::text)
15. 4.440 4.440 ↑ 1.0 5,078 1

Seq Scan on operazioni operazioni_1 (cost=0.00..1,303.55 rows=5,078 width=45) (actual time=0.010..4.440 rows=5,078 loops=1)

  • Filter: ((type)::text = 'BW'::text)
  • Rows Removed by Filter: 21446
16. 0.118 25.086 ↑ 1.0 227 1

Hash (cost=4,931.57..4,931.57 rows=227 width=278) (actual time=25.086..25.086 rows=227 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 79kB
17. 0.674 24.968 ↑ 1.0 227 1

Hash Right Join (cost=4,694.96..4,931.57 rows=227 width=278) (actual time=24.811..24.968 rows=227 loops=1)

  • Hash Cond: ((bids.id)::text = (aste.winning_bid)::text)
18. 0.592 0.592 ↑ 1.0 6,180 1

Seq Scan on bids (cost=0.00..211.80 rows=6,180 width=130) (actual time=0.014..0.592 rows=6,180 loops=1)

19. 0.077 23.702 ↑ 1.0 227 1

Hash (cost=4,692.12..4,692.12 rows=227 width=189) (actual time=23.702..23.702 rows=227 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 59kB
20. 0.527 23.625 ↑ 1.0 227 1

Hash Right Join (cost=4,604.34..4,692.12 rows=227 width=189) (actual time=22.483..23.625 rows=227 loops=1)

  • Hash Cond: ((operazioni_3.bids_id)::text = (aste.winning_bid)::text)
21. 2.445 7.006 ↓ 1.4 5,096 1

HashAggregate (cost=1,398.34..1,434.82 rows=3,648 width=49) (actual time=6.384..7.006 rows=5,096 loops=1)

  • Group Key: operazioni_3.bids_id
22. 4.561 4.561 ↓ 1.0 5,837 1

Seq Scan on operazioni operazioni_3 (cost=0.00..1,369.86 rows=5,695 width=45) (actual time=0.020..4.561 rows=5,837 loops=1)

  • Filter: (((type)::text = 'SW'::text) OR ((type)::text = 'SWI'::text))
  • Rows Removed by Filter: 20687
23. 0.062 16.092 ↑ 1.0 227 1

Hash (cost=3,203.17..3,203.17 rows=227 width=181) (actual time=16.092..16.092 rows=227 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 56kB
24. 0.454 16.030 ↑ 1.0 227 1

Hash Right Join (cost=3,122.51..3,203.17 rows=227 width=181) (actual time=15.037..16.030 rows=227 loops=1)

  • Hash Cond: ((operazioni_4.bids_id)::text = (aste.winning_bid)::text)
25. 2.110 7.271 ↓ 1.4 4,604 1

HashAggregate (cost=1,394.55..1,428.07 rows=3,352 width=49) (actual time=6.723..7.271 rows=4,604 loops=1)

  • Group Key: operazioni_4.bids_id
26. 5.161 5.161 ↑ 1.0 4,705 1

Seq Scan on operazioni operazioni_4 (cost=0.00..1,369.86 rows=4,938 width=45) (actual time=0.024..5.161 rows=4,705 loops=1)

  • Filter: (((type)::text = 'PD'::text) AND ((completato)::text = 'OK'::text))
  • Rows Removed by Filter: 21819
27. 0.078 8.305 ↑ 1.0 227 1

Hash (cost=1,725.12..1,725.12 rows=227 width=173) (actual time=8.305..8.305 rows=227 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 56kB
28. 0.527 8.227 ↑ 1.0 227 1

Hash Right Join (cost=1,644.63..1,725.12 rows=227 width=173) (actual time=7.165..8.227 rows=227 loops=1)

  • Hash Cond: ((operazioni_5.bids_id)::text = (aste.winning_bid)::text)
29. 2.113 7.463 ↓ 1.4 4,604 1

HashAggregate (cost=1,394.47..1,427.92 rows=3,345 width=49) (actual time=6.856..7.463 rows=4,604 loops=1)

  • Group Key: operazioni_5.bids_id
30. 5.350 5.350 ↑ 1.0 4,687 1

Seq Scan on operazioni operazioni_5 (cost=0.00..1,369.86 rows=4,921 width=45) (actual time=0.028..5.350 rows=4,687 loops=1)

  • Filter: (((type)::text = 'BS'::text) AND ((completato)::text = 'OK'::text))
  • Rows Removed by Filter: 21837
31. 0.088 0.237 ↑ 1.0 227 1

Hash (cost=247.33..247.33 rows=227 width=165) (actual time=0.237..0.237 rows=227 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 55kB
32. 0.118 0.149 ↑ 1.0 227 1

Bitmap Heap Scan on aste (cost=6.04..247.33 rows=227 width=165) (actual time=0.039..0.149 rows=227 loops=1)

  • Recheck Cond: ((stato)::text = 'ANTICIPATA'::text)
  • Heap Blocks: exact=44
33. 0.031 0.031 ↑ 1.0 227 1

Bitmap Index Scan on aste_stato_index (cost=0.00..5.98 rows=227 width=0) (actual time=0.031..0.031 rows=227 loops=1)

  • Index Cond: ((stato)::text = 'ANTICIPATA'::text)
34. 1.362 13.393 ↑ 1.0 1 227

Limit (cost=23.46..23.46 rows=1 width=58) (actual time=0.058..0.059 rows=1 loops=227)

35. 6.583 12.031 ↑ 1.0 1 227

Sort (cost=23.46..23.46 rows=1 width=58) (actual time=0.053..0.053 rows=1 loops=227)

  • Sort Key: operazioni_6.data DESC
  • Sort Method: quicksort Memory: 25kB
36. 1.589 5.448 ↑ 1.0 1 227

Bitmap Heap Scan on operazioni operazioni_6 (cost=4.45..23.45 rows=1 width=58) (actual time=0.022..0.024 rows=1 loops=227)

  • Recheck Cond: ((aste.winning_bid)::text = (bids_id)::text)
  • Filter: ((type)::text = 'PD'::text)
  • Rows Removed by Filter: 4
  • Heap Blocks: exact=418
37. 3.859 3.859 ↓ 1.2 6 227

Bitmap Index Scan on operazioni_bids_id_index (cost=0.00..4.45 rows=5 width=0) (actual time=0.016..0.017 rows=6 loops=227)

  • Index Cond: ((aste.winning_bid)::text = (bids_id)::text)
38. 3.455 5.843 ↑ 1.0 7,264 1

Hash (cost=334.64..334.64 rows=7,264 width=224) (actual time=5.843..5.843 rows=7,264 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 1703kB
39. 2.388 2.388 ↑ 1.0 7,264 1

Seq Scan on fatture (cost=0.00..334.64 rows=7,264 width=224) (actual time=0.021..2.388 rows=7,264 loops=1)

40. 1.816 1.816 ↑ 1.0 1 227

Index Scan using sellers_primary_key_id on sellers (cost=0.28..0.42 rows=1 width=83) (actual time=0.008..0.008 rows=1 loops=227)

  • Index Cond: ((id)::text = (fatture.sellers_id)::text)
41. 0.252 5.597 ↑ 1.1 1,302 1

Hash (cost=697.59..697.59 rows=1,415 width=41) (actual time=5.597..5.597 rows=1,302 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 109kB
42. 0.076 5.345 ↑ 1.1 1,302 1

Subquery Scan on debtors (cost=669.29..697.59 rows=1,415 width=41) (actual time=5.133..5.345 rows=1,302 loops=1)

43. 1.007 5.269 ↑ 1.1 1,302 1

HashAggregate (cost=669.29..683.44 rows=1,415 width=146) (actual time=5.131..5.269 rows=1,302 loops=1)

  • Group Key: di.sellers_id
44. 1.015 4.262 ↑ 1.0 3,826 1

Hash Join (cost=414.83..659.72 rows=3,826 width=41) (actual time=1.847..4.262 rows=3,826 loops=1)

  • Hash Cond: ((di.debtors_id)::text = (d.id)::text)
45. 1.451 1.451 ↑ 1.0 3,826 1

Seq Scan on debtorsinfo di (cost=0.00..234.84 rows=3,826 width=82) (actual time=0.024..1.451 rows=3,826 loops=1)

  • Filter: ((stato)::text <> 'DEL'::text)
  • Rows Removed by Filter: 881
46. 0.807 1.796 ↑ 1.0 3,948 1

Hash (cost=365.48..365.48 rows=3,948 width=41) (actual time=1.796..1.796 rows=3,948 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 314kB
47. 0.989 0.989 ↑ 1.0 3,948 1

Seq Scan on debtors d (cost=0.00..365.48 rows=3,948 width=41) (actual time=0.013..0.989 rows=3,948 loops=1)

48. 0.954 5.278 ↑ 1.0 5,078 1

Hash (cost=1,303.55..1,303.55 rows=5,078 width=41) (actual time=5.278..5.278 rows=5,078 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 427kB
49. 4.324 4.324 ↑ 1.0 5,078 1

Seq Scan on operazioni operazioni_2 (cost=0.00..1,303.55 rows=5,078 width=41) (actual time=0.010..4.324 rows=5,078 loops=1)

  • Filter: ((type)::text = 'BW'::text)
  • Rows Removed by Filter: 21446
50. 0.032 0.071 ↑ 1.0 121 1

Hash (cost=6.21..6.21 rows=121 width=64) (actual time=0.071..0.071 rows=121 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
51. 0.039 0.039 ↑ 1.0 121 1

Seq Scan on buyers (cost=0.00..6.21 rows=121 width=64) (actual time=0.015..0.039 rows=121 loops=1)

52. 1.107 4.398 ↑ 1.0 5,232 1

Hash (cost=347.34..347.34 rows=5,232 width=49) (actual time=4.398..4.398 rows=5,232 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 478kB
53. 2.760 3.291 ↑ 1.0 5,232 1

HashAggregate (cost=242.70..295.02 rows=5,232 width=49) (actual time=2.526..3.291 rows=5,232 loops=1)

  • Group Key: bids_1.aste_id
54. 0.531 0.531 ↑ 1.0 6,180 1

Seq Scan on bids bids_1 (cost=0.00..211.80 rows=6,180 width=41) (actual time=0.009..0.531 rows=6,180 loops=1)

55. 2.043 2.043 ↑ 1.0 1 227

Index Scan using clienti_primary_key_id on clienti (cost=0.28..0.58 rows=1 width=830) (actual time=0.009..0.009 rows=1 loops=227)

  • Index Cond: ((id)::text = (fatture.clienti_id)::text)
56. 0.035 0.072 ↑ 1.0 180 1

Hash (cost=7.80..7.80 rows=180 width=28) (actual time=0.072..0.072 rows=180 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
57. 0.037 0.037 ↑ 1.0 180 1

Seq Scan on intermediari i (cost=0.00..7.80 rows=180 width=28) (actual time=0.013..0.037 rows=180 loops=1)

58. 6.583 3,617.472 ↑ 1.0 1 227

Aggregate (cost=3,663.92..3,663.93 rows=1 width=32) (actual time=15.936..15.936 rows=1 loops=227)

59. 739.339 3,610.889 ↓ 2.0 4 227

Hash Join (cost=2,700.82..3,663.91 rows=2 width=40) (actual time=12.720..15.907 rows=4 loops=227)

  • Hash Cond: ((docs_archive.documents_id)::text = (documents.id)::text)
60. 553.426 553.426 ↑ 1.0 27,888 227

Seq Scan on docs_archive (cost=0.00..889.88 rows=27,888 width=40) (actual time=0.002..2.438 rows=27,888 loops=227)

61. 4.086 2,318.124 ↑ 1.2 5 227

Hash (cost=2,700.75..2,700.75 rows=6 width=40) (actual time=10.212..10.212 rows=5 loops=227)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
62. 2,314.038 2,314.038 ↑ 1.2 5 227

Seq Scan on documents (cost=0.00..2,700.75 rows=6 width=40) (actual time=5.883..10.194 rows=5 loops=227)

  • Filter: ((entity_id)::text = (fatture.id)::text)
  • Rows Removed by Filter: 75655
Planning time : 8.377 ms
Execution time : 3,707.553 ms