explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hEYt

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 2,797.595 ↑ 1.0 21 1

Limit (cost=253,999.33..254,003.27 rows=21 width=763) (actual time=2,797.500..2,797.595 rows=21 loops=1)

2. 0.090 2,797.592 ↑ 9,661.0 21 1

Unique (cost=253,999.33..292,039.33 rows=202,880 width=763) (actual time=2,797.498..2,797.592 rows=21 loops=1)

3. 793.469 2,797.502 ↑ 9,661.0 21 1

Sort (cost=253,999.33..254,506.53 rows=202,880 width=763) (actual time=2,797.496..2,797.502 rows=21 loops=1)

  • Sort Key: swipe_app_invoice.created DESC, swipe_app_invoice.id DESC, swipe_app_invoice.uid, swipe_app_invoice.min_fee_fix, swipe_app_invoice.max_fee_fix, swipe_app_invoice.fee_sell, swipe_app_invoice.fee_fix_sell, swipe_app_invoice.account_id, swipe_app_invoice.created_by_id, swipe_app_invoice.currency_id, swipe_app_invoice.brand_id, swipe_app_invoice.due, swipe_app_invoice.due_strict, swipe_app_invoice.discount_percent, swipe_app_invoice.fee, swipe_app_invoice.vat_enabled, swipe_app_invoice.skip_capture, swipe_app_invoice.language_id, swipe_app_invoice.sender_ident, swipe_app_invoice.total, swipe_app_invoice.subtotal_override, swipe_app_invoice.vat_amount_override, swipe_app_invoice.discount_amount_override, swipe_app_invoice.total_override, swipe_app_invoice.issued_override, swipe_app_invoice.hash, swipe_app_invoice.client_id, swipe_app_invoice.number, swipe_app_invoice.reference_id, swipe_app_invoice.timezone, swipe_app_invoice.is_test, swipe_app_invoice.is_moto, swipe_app_invoice.is_qcash_sms, swipe_app_invoice.dynamic_descriptor, swipe_app_invoice.from_api, swipe_app_invoice.from_subscription, swipe_app_invoice.fee_override, swipe_app_invoice.fee_discount, swipe_app_invoice.status, swipe_app_invoice.paid_on, swipe_app_invoice.cleared_on, swipe_app_invoice.paid_with, swipe_app_invoice.payment_system, swipe_app_invoice.decta_imported_payment_id, swipe_app_invoice.amount_refunded, swipe_app_merchant.product_permissions, swipe_app_account.acquirer, swipe_app_account.descriptor, swipe_app_account.descriptor_city, swipe_app_user.uid, swipe_app_user.email, swipe_app_user.title, swipe_app_currency.code, swipe_app_merchantbrand.uid, swipe_app_merchantbrand.company_name, swipe_app_merchantbrand.logo_new_id, swipe_app_merchantbrand.use_dies, swipe_app_merchantimage.id, swipe_app_merchantimage.uid, swipe_app_merchantimage.merchant_id, swipe_app_merchantimage.image, swipe_app_merchantimage.image_type, swipe_app_merchantimage.width, swipe_app_merchantimage.height, swipe_app_merchantimage.original_filename, swipe_app_merchantimage.created, swipe_app_language.code, swipe_app_invoiceclient.email, swipe_app_invoiceclient.phone, swipe_app_invoiceclient.name, swipe_app_invoiceclient.company_name, swipe_app_invoiceclient.legal_name, swipe_app_invoiceclient.send_to_email, swipe_app_invoiceclient.send_to_phone
  • Sort Method: external merge Disk: 172336kB
4. 566.045 2,004.033 ↑ 1.0 202,875 1

Hash Join (cost=57,803.31..98,810.19 rows=202,880 width=763) (actual time=1,274.820..2,004.033 rows=202,875 loops=1)

  • Hash Cond: (swipe_app_invoiceclient.id = swipe_app_invoice.client_id)
5. 164.720 164.720 ↓ 1.0 349,389 1

Seq Scan on swipe_app_invoiceclient (cost=0.00..12,615.87 rows=349,387 width=56) (actual time=0.025..164.720 rows=349,389 loops=1)

6. 426.280 1,273.268 ↑ 1.0 202,875 1

Hash (cost=37,039.31..37,039.31 rows=202,880 width=707) (actual time=1,273.268..1,273.268 rows=202,875 loops=1)

  • Buckets: 8192 Batches: 64 Memory Usage: 2737kB
7. 106.366 846.988 ↑ 1.0 202,875 1

Hash Join (cost=30.53..37,039.31 rows=202,880 width=707) (actual time=0.346..846.988 rows=202,875 loops=1)

  • Hash Cond: (swipe_app_invoice.language_id = swipe_app_language.id)
8. 94.891 740.613 ↑ 1.0 202,875 1

Hash Join (cost=29.41..34,248.60 rows=202,880 width=691) (actual time=0.334..740.613 rows=202,875 loops=1)

  • Hash Cond: (swipe_app_invoice.currency_id = swipe_app_currency.id)
9. 92.014 645.693 ↑ 1.0 202,875 1

Hash Join (cost=26.50..31,456.09 rows=202,880 width=683) (actual time=0.302..645.693 rows=202,875 loops=1)

  • Hash Cond: (swipe_app_invoice.created_by_id = swipe_app_user.id)
10. 92.180 553.643 ↑ 1.0 202,875 1

Hash Join (cost=21.65..28,661.63 rows=202,880 width=631) (actual time=0.263..553.643 rows=202,875 loops=1)

  • Hash Cond: (swipe_app_invoice.account_id = swipe_app_account.id)
11. 57.495 461.409 ↑ 1.0 202,875 1

Nested Loop (cost=14.03..25,864.41 rows=202,880 width=619) (actual time=0.206..461.409 rows=202,875 loops=1)

12. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on swipe_app_merchant (cost=0.00..5.45 rows=1 width=97) (actual time=0.012..0.018 rows=1 loops=1)

  • Filter: (id = 117)
  • Rows Removed by Filter: 35
13. 109.478 403.896 ↑ 1.0 202,875 1

Hash Join (cost=14.03..23,830.16 rows=202,880 width=522) (actual time=0.190..403.896 rows=202,875 loops=1)

  • Hash Cond: (swipe_app_invoice.brand_id = swipe_app_merchantbrand.id)
14. 294.244 294.244 ↑ 1.0 202,875 1

Seq Scan on swipe_app_invoice (cost=0.00..21,026.54 rows=202,880 width=388) (actual time=0.011..294.244 rows=202,875 loops=1)

  • Filter: (merchant_id = 117)
  • Rows Removed by Filter: 199
15. 0.018 0.174 ↓ 1.0 76 1

Hash (cost=13.10..13.10 rows=74 width=134) (actual time=0.174..0.174 rows=76 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
16. 0.066 0.156 ↓ 1.0 76 1

Hash Left Join (cost=5.92..13.10 rows=74 width=134) (actual time=0.081..0.156 rows=76 loops=1)

  • Hash Cond: (swipe_app_merchantbrand.logo_new_id = swipe_app_merchantimage.id)
17. 0.017 0.017 ↓ 1.0 76 1

Seq Scan on swipe_app_merchantbrand (cost=0.00..6.74 rows=74 width=38) (actual time=0.004..0.017 rows=76 loops=1)

18. 0.034 0.073 ↓ 1.0 135 1

Hash (cost=4.30..4.30 rows=130 width=96) (actual time=0.073..0.073 rows=135 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
19. 0.039 0.039 ↓ 1.0 135 1

Seq Scan on swipe_app_merchantimage (cost=0.00..4.30 rows=130 width=96) (actual time=0.005..0.039 rows=135 loops=1)

20. 0.015 0.054 ↑ 1.1 63 1

Hash (cost=6.72..6.72 rows=72 width=12) (actual time=0.054..0.054 rows=63 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
21. 0.039 0.039 ↑ 1.1 63 1

Seq Scan on swipe_app_account (cost=0.00..6.72 rows=72 width=12) (actual time=0.004..0.039 rows=63 loops=1)

22. 0.009 0.036 ↓ 1.3 48 1

Hash (cost=4.38..4.38 rows=38 width=52) (actual time=0.036..0.036 rows=48 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
23. 0.027 0.027 ↓ 1.3 48 1

Seq Scan on swipe_app_user (cost=0.00..4.38 rows=38 width=52) (actual time=0.005..0.027 rows=48 loops=1)

24. 0.014 0.029 ↑ 1.0 85 1

Hash (cost=1.85..1.85 rows=85 width=8) (actual time=0.029..0.029 rows=85 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
25. 0.015 0.015 ↑ 1.0 85 1

Seq Scan on swipe_app_currency (cost=0.00..1.85 rows=85 width=8) (actual time=0.005..0.015 rows=85 loops=1)

26. 0.003 0.009 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=16) (actual time=0.009..0.009 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.006 0.006 ↑ 1.0 5 1

Seq Scan on swipe_app_language (cost=0.00..1.05 rows=5 width=16) (actual time=0.005..0.006 rows=5 loops=1)

Planning time : 14.908 ms
Execution time : 3,219.957 ms