explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tRx7 : good

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 2,555.193 ↓ 0.0 0 1

Sort (cost=165.51..165.52 rows=3 width=730) (actual time=2,555.193..2,555.193 rows=0 loops=1)

  • Sort Key: sso.created_at DESC
  • Sort Method: quicksort Memory: 25kB
2.          

CTE myconstants

3. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=160) (actual time=0.001..0.001 rows=1 loops=1)

4. 0.001 2,555.182 ↓ 0.0 0 1

Nested Loop (cost=128.89..165.45 rows=3 width=730) (actual time=2,555.182..2,555.182 rows=0 loops=1)

5. 0.000 2,555.181 ↓ 0.0 0 1

Nested Loop (cost=128.74..164.83 rows=3 width=1,064) (actual time=2,555.181..2,555.181 rows=0 loops=1)

6. 0.001 2,555.181 ↓ 0.0 0 1

Nested Loop (cost=128.32..160.71 rows=3 width=1,030) (actual time=2,555.181..2,555.181 rows=0 loops=1)

7. 0.004 2,555.180 ↓ 0.0 0 1

Nested Loop (cost=127.90..155.94 rows=6 width=981) (actual time=2,555.180..2,555.180 rows=0 loops=1)

8. 0.003 0.003 ↑ 1.0 1 1

CTE Scan on myconstants (cost=0.00..0.02 rows=1 width=160) (actual time=0.002..0.003 rows=1 loops=1)

9. 0.003 2,555.173 ↓ 0.0 0 1

Bitmap Heap Scan on spy_sales_order_address ssoa (cost=127.90..155.86 rows=6 width=821) (actual time=2,555.173..2,555.173 rows=0 loops=1)

  • Recheck Cond: ((((((((COALESCE(address1, ''::character varying))::text || ' '::text) || (COALESCE(address2, ''::character varying))::text) || ' '::text) || (COALESCE(address3, ''::character varying))::text) % myconstants.var3) AND ((((COALESCE(zip_code, ''::character varying))::text || ' '::text) || (COALESCE(city, ''::character varying))::text) % myconstants.var4)) OR ((email)::text = myconstants.var5))
  • Filter: (((((((COALESCE(first_name, ''::character varying))::text || ' '::text) || (COALESCE(middle_name, ''::character varying))::text) || (COALESCE(last_name, ''::character varying))::text) % ((myconstants.var1 || ' '::text) || myconstants.var2)) AND ((((((COALESCE(address1, ''::character varying))::text || ' '::text) || (COALESCE(address2, ''::character varying))::text) || ' '::text) || (COALESCE(address3, ''::character varying))::text) % myconstants.var3) AND ((((COALESCE(zip_code, ''::character varying))::text || ' '::text) || (COALESCE(city, ''::character varying))::text) % myconstants.var4)) OR ((email)::text = myconstants.var5))
10. 0.014 2,555.170 ↓ 0.0 0 1

BitmapOr (cost=127.90..127.90 rows=7 width=0) (actual time=2,555.170..2,555.170 rows=0 loops=1)

11. 0.042 2,555.122 ↓ 0.0 0 1

BitmapAnd (cost=123.43..123.43 rows=1 width=0) (actual time=2,555.122..2,555.122 rows=0 loops=1)

12. 2,071.883 2,071.883 ↑ 119.6 8 1

Bitmap Index Scan on spy_sales_order_address_addressindex (cost=0.00..59.59 rows=957 width=0) (actual time=2,071.883..2,071.883 rows=8 loops=1)

  • Index Cond: ((((((COALESCE(address1, ''::character varying))::text || ' '::text) || (COALESCE(address2, ''::character varying))::text) || ' '::text) || (COALESCE(address3, ''::character varying))::text) % myconstants.var3)
13. 483.197 483.197 ↓ 0.0 0 1

Bitmap Index Scan on spy_sales_order_address_zipcityindex (cost=0.00..63.59 rows=957 width=0) (actual time=483.197..483.197 rows=0 loops=1)

  • Index Cond: ((((COALESCE(zip_code, ''::character varying))::text || ' '::text) || (COALESCE(city, ''::character varying))::text) % myconstants.var4)
14. 0.034 0.034 ↓ 0.0 0 1

Bitmap Index Scan on spy_sales_order_address_email_index (cost=0.00..4.47 rows=6 width=0) (actual time=0.034..0.034 rows=0 loops=1)

  • Index Cond: ((email)::text = myconstants.var5)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using spy_sales_order_fk_sales_order_address_shipping_index on spy_sales_order sso (cost=0.42..0.79 rows=1 width=57) (never executed)

  • Index Cond: (fk_sales_order_address_shipping = ssoa.id_sales_order_address)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using spy_sales_order_item_fk_sales_order_index on spy_sales_order_item ssoi (cost=0.42..1.36 rows=1 width=38) (never executed)

  • Index Cond: (fk_sales_order = sso.id_sales_order)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using spy_oms_order_item_state_pkey on spy_oms_order_item_state soois (cost=0.14..0.16 rows=1 width=28) (never executed)

  • Index Cond: (id_oms_order_item_state = ssoi.fk_oms_order_item_state)
Planning time : 1.207 ms
Execution time : 2,555.692 ms