explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ozrz

Settings
# exclusive inclusive rows x rows loops node
1. 725.031 2,014.514 ↑ 1.0 1 1

Aggregate (cost=115,510.43..115,510.44 rows=1 width=16) (actual time=2,014.513..2,014.514 rows=1 loops=1)

2. 260.338 1,289.483 ↓ 3.5 551,067 1

Hash Right Join (cost=106,716.24..115,119.12 rows=156,523 width=16) (actual time=951.807..1,289.483 rows=551,067 loops=1)

  • Hash Cond: ("categories.product_categories"."productId" = product._id)
3. 53.919 77.667 ↑ 1.0 152,116 1

Hash Join (cost=37.25..5,309.67 rows=156,523 width=16) (actual time=0.252..77.667 rows=152,116 loops=1)

  • Hash Cond: ("categories.product_categories"."categoryId" = categories._id)
4. 23.531 23.531 ↑ 1.0 152,116 1

Seq Scan on product_categories "categories.product_categories" (cost=0.00..3,120.23 rows=156,523 width=32) (actual time=0.009..23.531 rows=152,116 loops=1)

5. 0.102 0.217 ↑ 1.0 472 1

Hash (cost=31.35..31.35 rows=472 width=16) (actual time=0.217..0.217 rows=472 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
6. 0.115 0.115 ↑ 1.0 472 1

Index Only Scan using categories_pkey on categories (cost=0.27..31.35 rows=472 width=16) (actual time=0.030..0.115 rows=472 loops=1)

  • Heap Fetches: 20
7. 88.350 951.478 ↓ 3.1 313,956 1

Hash (cost=105,408.58..105,408.58 rows=101,632 width=16) (actual time=951.478..951.478 rows=313,956 loops=1)

  • Buckets: 16384 Batches: 2 (originally 1) Memory Usage: 8193kB
8. 150.724 863.128 ↓ 3.1 313,956 1

Hash Right Join (cost=99,744.35..105,408.58 rows=101,632 width=16) (actual time=686.328..863.128 rows=313,956 loops=1)

  • Hash Cond: (stocks."productId" = product._id)
9. 26.138 26.138 ↑ 1.0 95,840 1

Seq Scan on stocks (cost=0.00..3,747.41 rows=95,841 width=32) (actual time=0.020..26.138 rows=95,840 loops=1)

10. 33.300 686.266 ↓ 1.6 157,726 1

Hash (cost=98,473.95..98,473.95 rows=101,632 width=16) (actual time=686.266..686.266 rows=157,726 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 7394kB
11. 95.811 652.966 ↓ 1.6 157,726 1

Hash Right Join (cost=94,071.47..98,473.95 rows=101,632 width=16) (actual time=519.890..652.966 rows=157,726 loops=1)

  • Hash Cond: ("materials.product_materials"."productId" = product._id)
12. 23.798 37.428 ↑ 1.0 77,877 1

Hash Join (cost=17.72..2,835.98 rows=79,211 width=16) (actual time=0.130..37.428 rows=77,877 loops=1)

  • Hash Cond: ("materials.product_materials"."materialId" = materials._id)
13. 13.549 13.549 ↑ 1.0 77,877 1

Seq Scan on product_materials "materials.product_materials" (cost=0.00..1,729.11 rows=79,211 width=32) (actual time=0.021..13.549 rows=77,877 loops=1)

14. 0.015 0.081 ↑ 1.0 53 1

Hash (cost=17.06..17.06 rows=53 width=16) (actual time=0.081..0.081 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
15. 0.066 0.066 ↑ 1.0 53 1

Index Only Scan using materials_pkey on materials (cost=0.27..17.06 rows=53 width=16) (actual time=0.035..0.066 rows=53 loops=1)

  • Heap Fetches: 29
16. 32.690 519.727 ↓ 1.4 138,612 1

Hash (cost=92,783.35..92,783.35 rows=101,632 width=16) (actual time=519.727..519.727 rows=138,612 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 6498kB
17. 97.683 487.037 ↓ 1.4 138,612 1

Hash Right Join (cost=88,310.07..92,783.35 rows=101,632 width=16) (actual time=345.507..487.037 rows=138,612 loops=1)

  • Hash Cond: ("colors.product_colors"."productId" = product._id)
18. 29.694 43.912 ↓ 1.2 94,742 1

Hash Join (cost=2.72..3,189.29 rows=79,182 width=16) (actual time=0.031..43.912 rows=94,742 loops=1)

  • Hash Cond: ("colors.product_colors"."colorId" = colors._id)
19. 14.208 14.208 ↓ 1.2 94,742 1

Seq Scan on product_colors "colors.product_colors" (cost=0.00..2,097.82 rows=79,182 width=32) (actual time=0.003..14.208 rows=94,742 loops=1)

20. 0.004 0.010 ↑ 2.1 15 1

Hash (cost=2.32..2.32 rows=32 width=16) (actual time=0.010..0.010 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
21. 0.006 0.006 ↑ 2.1 15 1

Seq Scan on colors (cost=0.00..2.32 rows=32 width=16) (actual time=0.002..0.006 rows=15 loops=1)

22. 32.676 345.442 ↓ 1.2 121,988 1

Hash (cost=87,036.95..87,036.95 rows=101,632 width=16) (actual time=345.442..345.442 rows=121,988 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 5719kB
23. 80.790 312.766 ↓ 1.2 121,988 1

Hash Left Join (cost=1,643.20..87,036.95 rows=101,632 width=16) (actual time=20.691..312.766 rows=121,988 loops=1)

  • Hash Cond: (product._id = "sizes.product_sizes"."productId")
24. 211.305 211.305 ↑ 1.0 101,453 1

Seq Scan on products product (cost=0.00..81,918.32 rows=101,632 width=64) (actual time=0.009..211.305 rows=101,453 loops=1)

25. 5.612 20.671 ↑ 1.0 28,989 1

Hash (cost=1,268.91..1,268.91 rows=29,943 width=16) (actual time=20.671..20.671 rows=28,989 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1359kB
26. 9.334 15.059 ↑ 1.0 28,989 1

Hash Join (cost=8.77..1,268.91 rows=29,943 width=16) (actual time=0.074..15.059 rows=28,989 loops=1)

  • Hash Cond: ("sizes.product_sizes"."sizeId" = sizes._id)
27. 5.672 5.672 ↑ 1.0 28,989 1

Seq Scan on product_sizes "sizes.product_sizes" (cost=0.00..848.43 rows=29,943 width=32) (actual time=0.013..5.672 rows=28,989 loops=1)

28. 0.024 0.053 ↑ 1.0 123 1

Hash (cost=7.23..7.23 rows=123 width=16) (actual time=0.053..0.053 rows=123 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
29. 0.029 0.029 ↑ 1.0 123 1

Seq Scan on sizes (cost=0.00..7.23 rows=123 width=16) (actual time=0.008..0.029 rows=123 loops=1)