explain.depesz.com

A tool for finding a real cause for slow queries.

Result: PCh

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 30.939 302.841 ↑ 1.0 1 1

Aggregate (cost=20,000,015,261.89..20,000,015,261.90 rows=1 width=7) (actual time=302.840..302.841 rows=1 loops=1)

2. 16.380 271.902 ↑ 1.0 72,495 1

Hash Left Join (cost=20,000,003,986.21..20,000,014,899.41 rows=72,495 width=7) (actual time=41.205..271.902 rows=72,495 loops=1)

  • Hash Cond: (payment.category_id = payment_category.id)
3. 34.668 249.089 ↑ 1.0 72,495 1

Hash Left Join (cost=20,000,003,923.81..20,000,014,565.14 rows=72,495 width=15) (actual time=34.729..249.089 rows=72,495 loops=1)

  • Hash Cond: (payment_group_sale.id = sale.group_id)
4. 26.511 199.044 ↑ 1.0 72,495 1

Hash Join (cost=10,000,001,946.73..10,000,011,138.16 rows=72,495 width=23) (actual time=19.330..199.044 rows=72,495 loops=1)

  • Hash Cond: (payment.method_id = payment_method.id)
5. 32.798 172.493 ↑ 1.0 72,495 1

Hash Left Join (cost=10,000,001,885.01..10,000,010,079.63 rows=72,495 width=31) (actual time=19.279..172.493 rows=72,495 loops=1)

  • Hash Cond: (payment.group_id = payment_group_purchase.id)
6. 33.774 132.292 ↑ 1.0 72,495 1

Hash Left Join (cost=1,217.65..7,962.37 rows=72,495 width=39) (actual time=11.857..132.292 rows=72,495 loops=1)

  • Hash Cond: (payment.group_id = payment_group.id)
7. 53.345 92.662 ↑ 1.0 72,495 1

Hash Left Join (cost=608.82..5,903.65 rows=72,495 width=39) (actual time=5.982..92.662 rows=72,495 loops=1)

  • Hash Cond: (payment.group_id = payment_group_sale.id)
8. 33.417 33.417 ↑ 1.0 72,495 1

Index Scan using payment_test on payment (cost=0.00..3,844.92 rows=72,495 width=31) (actual time=0.062..33.417 rows=72,495 loops=1)

  • Index Cond: (payment_type = 0)
9. 2.212 5.900 ↑ 1.0 11,476 1

Hash (cost=465.37..465.37 rows=11,476 width=8) (actual time=5.900..5.900 rows=11,476 loops=1)

10. 3.688 3.688 ↑ 1.0 11,476 1

Index Scan using payment_group_pkey on payment_group payment_group_sale (cost=0.00..465.37 rows=11,476 width=8) (actual time=0.010..3.688 rows=11,476 loops=1)

11. 2.252 5.856 ↑ 1.0 11,476 1

Hash (cost=465.37..465.37 rows=11,476 width=8) (actual time=5.856..5.856 rows=11,476 loops=1)

12. 3.604 3.604 ↑ 1.0 11,476 1

Index Scan using payment_group_pkey on payment_group (cost=0.00..465.37 rows=11,476 width=8) (actual time=0.017..3.604 rows=11,476 loops=1)

13. 2.381 7.403 ↑ 1.0 11,476 1

Hash (cost=10,000,000,523.91..10,000,000,523.91 rows=11,476 width=8) (actual time=7.403..7.403 rows=11,476 loops=1)

14. 2.086 5.022 ↑ 1.0 11,476 1

Merge Left Join (cost=10,000,000,025.34..10,000,000,523.91 rows=11,476 width=8) (actual time=0.024..5.022 rows=11,476 loops=1)

  • Merge Cond: (payment_group_purchase.id = purchase_order.group_id)
15. 2.921 2.921 ↑ 1.0 11,476 1

Index Scan using payment_group_pkey on payment_group payment_group_purchase (cost=0.00..465.37 rows=11,476 width=8) (actual time=0.007..2.921 rows=11,476 loops=1)

16. 0.014 0.015 ↓ 0.0 0 1

Sort (cost=10,000,000,025.34..10,000,000,026.09 rows=300 width=8) (actual time=0.015..0.015 rows=0 loops=1)

  • Sort Key: purchase_order.group_id
  • Sort Method: quicksort Memory: 25kB
17. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on purchase_order (cost=10,000,000,000.00..10,000,000,013.00 rows=300 width=8) (actual time=0.001..0.001 rows=0 loops=1)

18. 0.005 0.040 ↑ 61.2 8 1

Hash (cost=55.60..55.60 rows=490 width=8) (actual time=0.040..0.040 rows=8 loops=1)

19. 0.035 0.035 ↑ 61.2 8 1

Index Scan using payment_method_pkey on payment_method (cost=0.00..55.60 rows=490 width=8) (actual time=0.030..0.035 rows=8 loops=1)

20. 2.465 15.377 ↑ 1.0 11,476 1

Hash (cost=10,000,001,831.48..10,000,001,831.48 rows=11,648 width=8) (actual time=15.377..15.377 rows=11,476 loops=1)

21. 12.912 12.912 ↑ 1.0 11,476 1

Seq Scan on sale (cost=10,000,000,000.00..10,000,001,831.48 rows=11,648 width=8) (actual time=0.023..12.912 rows=11,476 loops=1)

22. 0.000 6.433 ↓ 0.0 0 1

Hash (cost=54.15..54.15 rows=660 width=8) (actual time=6.433..6.433 rows=0 loops=1)

23. 6.433 6.433 ↓ 0.0 0 1

Index Scan using payment_category_pkey on payment_category (cost=0.00..54.15 rows=660 width=8) (actual time=6.433..6.433 rows=0 loops=1)