explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ceSr

Settings
# exclusive inclusive rows x rows loops node
1. 4.521 27,065.303 ↑ 18.7 104 1

GroupAggregate (cost=1,677,090.91..1,677,149.29 rows=1,946 width=93) (actual time=27,060.191..27,065.303 rows=104 loops=1)

  • Group Key: products.name, vendor_items.id
2. 4.913 27,060.782 ↓ 4.8 9,347 1

Sort (cost=1,677,090.91..1,677,095.78 rows=1,946 width=53) (actual time=27,060.137..27,060.782 rows=9,347 loops=1)

  • Sort Key: products.name, vendor_items.id
  • Sort Method: quicksort Memory: 1668kB
3. 3.702 27,055.869 ↓ 4.8 9,347 1

Nested Loop Left Join (cost=1,629,332.07..1,676,984.60 rows=1,946 width=53) (actual time=26,629.741..27,055.869 rows=9,347 loops=1)

4. 4.773 27,042.820 ↓ 4.8 9,347 1

Nested Loop (cost=1,629,331.65..1,669,394.16 rows=1,946 width=53) (actual time=26,629.730..27,042.820 rows=9,347 loops=1)

5. 103.340 27,028.700 ↓ 4.8 9,347 1

Hash Right Join (cost=1,629,331.22..1,661,725.98 rows=1,946 width=32) (actual time=26,629.706..27,028.700 rows=9,347 loops=1)

  • Hash Cond: (invoice_line_items.vendor_item_id = vendor_items.id)
6. 298.018 298.018 ↑ 1.0 1,127,280 1

Seq Scan on invoice_line_items (cost=0.00..28,160.80 rows=1,127,280 width=16) (actual time=0.845..298.018 rows=1,127,280 loops=1)

7. 0.136 26,627.342 ↑ 3.4 573 1

Hash (cost=1,629,306.89..1,629,306.89 rows=1,946 width=20) (actual time=26,627.342..26,627.342 rows=573 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 46kB
8. 21.213 26,627.206 ↑ 3.4 573 1

Hash Semi Join (cost=1,013,968.66..1,629,306.89 rows=1,946 width=20) (actual time=25,937.629..26,627.206 rows=573 loops=1)

  • Hash Cond: (accounts.id = accounts_1.id)
9. 239.304 26,584.271 ↑ 1.2 174,118 1

Hash Join (cost=983,998.28..1,598,779.04 rows=204,125 width=28) (actual time=25,368.462..26,584.271 rows=174,118 loops=1)

  • Hash Cond: (vendor_items.product_version_id = product_versions.id)
10. 527.604 25,991.653 ↑ 1.2 174,118 1

Hash Join (cost=940,488.09..1,544,917.13 rows=204,125 width=28) (actual time=24,200.128..25,991.653 rows=174,118 loops=1)

  • Hash Cond: (list_entries_samplings_join.vendor_product_version_id = vendor_items.id)
11. 330.356 24,440.405 ↑ 1.2 174,118 1

Hash Join (cost=828,695.09..1,417,204.26 rows=204,125 width=16) (actual time=15,624.926..24,440.405 rows=174,118 loops=1)

  • Hash Cond: (accounts_sample_lists.account_id = accounts.id)
12. 233.450 23,498.774 ↑ 1.2 174,118 1

Hash Join (cost=745,288.91..1,321,430.20 rows=204,125 width=12) (actual time=13,692.069..23,498.774 rows=174,118 loops=1)

  • Hash Cond: (samplings.accounts_sample_list_id = accounts_sample_lists.id)
13. 2,984.646 23,025.332 ↑ 1.2 174,118 1

Hash Join (cost=713,689.02..1,281,158.39 rows=204,125 width=12) (actual time=13,218.829..23,025.332 rows=174,118 loops=1)

  • Hash Cond: (list_entries_samplings_join.id = list_entries.id)
14. 6,890.808 6,890.808 ↓ 1.0 10,402,446 1

Seq Scan on list_entries list_entries_samplings_join (cost=0.00..444,321.18 rows=10,387,718 width=8) (actual time=0.007..6,890.808 rows=10,402,446 loops=1)

15. 30.267 13,149.878 ↑ 1.2 174,118 1

Hash (cost=710,140.46..710,140.46 rows=204,125 width=16) (actual time=13,149.878..13,149.878 rows=174,118 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3096kB
16. 1,662.976 13,119.611 ↑ 1.2 174,118 1

Hash Join (cost=538,967.26..710,140.46 rows=204,125 width=16) (actual time=10,276.197..13,119.611 rows=174,118 loops=1)

  • Hash Cond: (samplings.list_entry_id = list_entries.id)
17. 1,196.909 1,196.909 ↓ 1.0 5,724,125 1

Seq Scan on samplings (cost=0.00..90,318.69 rows=5,724,069 width=12) (actual time=0.006..1,196.909 rows=5,724,125 loops=1)

18. 125.277 10,259.726 ↓ 1.2 461,608 1

Hash (cost=532,888.82..532,888.82 rows=370,435 width=4) (actual time=10,259.726..10,259.726 rows=461,608 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3045kB
19. 2,449.732 10,134.449 ↓ 1.2 461,608 1

Hash Join (cost=45,909.35..532,888.82 rows=370,435 width=4) (actual time=203.720..10,134.449 rows=461,608 loops=1)

  • Hash Cond: (list_entries.list_id = lists.id)
20. 7,481.046 7,481.046 ↓ 1.0 10,402,446 1

Seq Scan on list_entries (cost=0.00..444,321.18 rows=10,387,718 width=8) (actual time=0.002..7,481.046 rows=10,402,446 loops=1)

21. 11.729 203.671 ↓ 1.0 64,219 1

Hash (cost=45,112.66..45,112.66 rows=63,735 width=4) (actual time=203.671..203.671 rows=64,219 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2770kB
22. 191.942 191.942 ↓ 1.0 64,219 1

Seq Scan on lists (cost=0.00..45,112.66 rows=63,735 width=4) (actual time=0.351..191.942 rows=64,219 loops=1)

  • Filter: (created_at > '2019-01-10 16:47:04.922605'::timestamp without time zone)
  • Rows Removed by Filter: 1723034
23. 130.847 239.992 ↑ 1.0 993,284 1

Hash (cost=15,302.84..15,302.84 rows=993,284 width=8) (actual time=239.992..239.992 rows=993,284 loops=1)

  • Buckets: 131072 Batches: 16 Memory Usage: 3458kB
24. 109.145 109.145 ↑ 1.0 993,284 1

Seq Scan on accounts_sample_lists (cost=0.00..15,302.84 rows=993,284 width=8) (actual time=0.007..109.145 rows=993,284 loops=1)

25. 306.459 611.275 ↑ 1.0 1,871,697 1

Hash (cost=52,697.97..52,697.97 rows=1,871,697 width=4) (actual time=611.275..611.275 rows=1,871,697 loops=1)

  • Buckets: 131072 Batches: 32 Memory Usage: 3095kB
26. 304.816 304.816 ↑ 1.0 1,871,697 1

Seq Scan on accounts (cost=0.00..52,697.97 rows=1,871,697 width=4) (actual time=0.007..304.816 rows=1,871,697 loops=1)

27. 395.351 1,023.644 ↑ 1.0 2,223,371 1

Hash (cost=73,119.50..73,119.50 rows=2,224,760 width=16) (actual time=1,023.644..1,023.644 rows=2,223,371 loops=1)

  • Buckets: 131072 Batches: 64 Memory Usage: 2724kB
28. 628.293 628.293 ↑ 1.0 2,223,371 1

Seq Scan on vendor_items (cost=0.00..73,119.50 rows=2,224,760 width=16) (actual time=0.021..628.293 rows=2,223,371 loops=1)

  • Filter: ((type)::text = 'VendorProductVersion'::text)
  • Rows Removed by Filter: 6
29. 187.994 353.314 ↑ 1.0 1,216,586 1

Hash (cost=23,549.86..23,549.86 rows=1,216,586 width=8) (actual time=353.314..353.314 rows=1,216,586 loops=1)

  • Buckets: 131072 Batches: 16 Memory Usage: 3999kB
30. 165.320 165.320 ↑ 1.0 1,216,586 1

Seq Scan on product_versions (cost=0.00..23,549.86 rows=1,216,586 width=8) (actual time=0.063..165.320 rows=1,216,586 loops=1)

31. 6.728 21.722 ↓ 1.0 18,681 1

Hash (cost=29,747.33..29,747.33 rows=17,844 width=4) (actual time=21.722..21.722 rows=18,681 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 913kB
32. 13.907 14.994 ↓ 1.0 18,681 1

Bitmap Heap Scan on accounts accounts_1 (cost=334.72..29,747.33 rows=17,844 width=4) (actual time=1.634..14.994 rows=18,681 loops=1)

  • Recheck Cond: (vendor_id = 174)
  • Heap Blocks: exact=3299
33. 1.087 1.087 ↓ 1.0 18,681 1

Bitmap Index Scan on index_accounts_on_vendor_id (cost=0.00..330.26 rows=17,844 width=0) (actual time=1.087..1.087 rows=18,681 loops=1)

  • Index Cond: (vendor_id = 174)
34. 9.347 9.347 ↑ 1.0 1 9,347

Index Scan using products_pkey on products (cost=0.43..3.93 rows=1 width=29) (actual time=0.001..0.001 rows=1 loops=9,347)

  • Index Cond: (id = product_versions.product_id)
35. 9.347 9.347 ↑ 1.0 1 9,347

Index Scan using invoices_pkey on invoices (cost=0.42..3.89 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=9,347)

  • Index Cond: (id = invoice_line_items.invoice_id)
Planning time : 3.074 ms
Execution time : 27,066.611 ms