explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 7e7 : Postgresql slow query explain analyze

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.001 1,887,657.013 ↓ 0.0 0 1

Limit (cost=0.00..1,388,733.68 rows=1,000 width=138) (actual time=1,887,657.013..1,887,657.013 rows=0 loops=1)

2. 46,807.216 1,887,657.012 ↓ 0.0 0 1

Nested Loop (cost=0.00..31,471,007,691.03 rows=22,661,658 width=138) (actual time=1,887,657.012..1,887,657.012 rows=0 loops=1)

  • Join Filter: (u."RoleId" = r."Id")
3. 0.000 1,840,849.796 ↑ 1.0 343,063,334 1

Nested Loop (cost=0.00..31,465,859,566.41 rows=343,208,229 width=122) (actual time=1.018..1,840,849.796 rows=343,063,334 loops=1)

4. 70,187.874 805,593.748 ↑ 1.0 346,511,117 1

Nested Loop (cost=0.00..17,722,559,954.00 rows=346,710,000 width=42) (actual time=0.586..805,593.748 rows=346,511,117 loops=1)

5. 35,405.874 35,405.874 ↑ 1.0 350,000,000 1

Seq Scan on "Payments" p (cost=0.00..5,724,570.00 rows=350,000,000 width=18) (actual time=0.019..35,405.874 rows=350,000,000 loops=1)

6. 700,000.000 700,000.000 ↑ 1.0 1 350,000,000

Index Scan using "PaymentOrders_pkey" on "PaymentOrders" po (cost=0.00..50.61 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=350,000,000)

  • Index Cond: ("Id" = p."PaymentOrderId")
7. 1,039,533.351 1,039,533.351 ↑ 1.0 1 346,511,117

Index Scan using "Users_pkey" on "Users" u (cost=0.00..39.63 rows=1 width=80) (actual time=0.002..0.003 rows=1 loops=346,511,117)

  • Index Cond: ("Id" = po."UserId")
8. 0.000 0.000 ↓ 0.0 0 343,063,334

Materialize (cost=0.00..1.19 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=343,063,334)

9. 0.016 0.016 ↓ 0.0 0 1

Seq Scan on "Roles" r (cost=0.00..1.19 rows=1 width=16) (actual time=0.016..0.016 rows=0 loops=1)

  • Filter: (("Name")::text = 'Moses2333'::text)
  • Rows Removed by Filter: 15