explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j1E8

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 269,057.910 ↑ 3.6 8 1

GroupAggregate (cost=257,594.47..257,595.12 rows=29 width=44) (actual time=269,057.906..269,057.910 rows=8 loops=1)

  • Group Key: ((orders.creation_date)::date), (COALESCE(cpf_receita_federals.situacao_cadastral, 'NÃO DISPONÍVEL'::character varying))
2. 0.029 269,057.901 ↑ 2.6 11 1

Sort (cost=257,594.47..257,594.54 rows=29 width=36) (actual time=269,057.900..269,057.901 rows=11 loops=1)

  • Sort Key: ((orders.creation_date)::date), (COALESCE(cpf_receita_federals.situacao_cadastral, 'NÃO DISPONÍVEL'::character varying))
  • Sort Method: quicksort Memory: 25kB
3. 0.007 269,057.872 ↑ 2.6 11 1

Nested Loop (cost=24.31..257,593.77 rows=29 width=36) (actual time=153,293.566..269,057.872 rows=11 loops=1)

4. 0.005 269,054.584 ↑ 1.0 1 1

Nested Loop (cost=24.31..257,528.23 rows=1 width=16) (actual time=153,291.538..269,054.584 rows=1 loops=1)

5. 267,279.288 269,054.563 ↑ 1.0 1 1

Hash Right Join (cost=23.88..257,519.77 rows=1 width=12) (actual time=153,291.520..269,054.563 rows=1 loops=1)

  • Hash Cond: (regexp_replace((cpf_receita_federals.cpf)::text, '(\d{3})\.(\d{3})\.(\d{3})\-(\d{2})'::text, '\1\2\3\4'::text) = (documents.document)::text)
6. 1,775.231 1,775.231 ↑ 1.0 8,468,981 1

Seq Scan on cpf_receita_federals (cost=0.00..215,070.92 rows=8,484,992 width=23) (actual time=0.009..1,775.231 rows=8,468,981 loops=1)

7. 0.004 0.044 ↑ 1.0 1 1

Hash (cost=23.87..23.87 rows=1 width=16) (actual time=0.044..0.044 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.000 0.040 ↑ 1.0 1 1

Nested Loop (cost=1.30..23.87 rows=1 width=16) (actual time=0.039..0.040 rows=1 loops=1)

9. 0.002 0.028 ↑ 1.0 1 1

Nested Loop (cost=0.87..16.91 rows=1 width=8) (actual time=0.027..0.028 rows=1 loops=1)

10. 0.011 0.011 ↑ 1.0 1 1

Index Scan using i_user_profiles_userid on user_profiles (cost=0.43..8.45 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=1)

  • Index Cond: (userid = 22,519,958)
11. 0.015 0.015 ↑ 1.0 1 1

Index Scan using user_documents_pkey on user_documents (cost=0.43..8.45 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (user_documentid = user_profiles.user_documentid)
12. 0.012 0.012 ↑ 1.0 1 1

Index Scan using documents_pkey on documents (cost=0.43..6.96 rows=1 width=16) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: (documentid = user_documents.documentid)
  • Filter: ((type)::text = 'CPF'::text)
13. 0.016 0.016 ↑ 1.0 1 1

Index Scan using users_pkey on users (cost=0.43..8.46 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=1)

  • Index Cond: (userid = 22,519,958)
  • Filter: ((category)::text !~~ '%qa%'::text)
14. 0.004 3.281 ↑ 2.6 11 1

Append (cost=0.00..65.17 rows=29 width=12) (actual time=2.024..3.281 rows=11 loops=1)

15. 0.064 0.064 ↓ 0.0 0 1

Seq Scan on orders (cost=0.00..39.00 rows=1 width=12) (actual time=0.064..0.064 rows=0 loops=1)

  • Filter: ((creation_date >= '2020-06-27 00:00:00'::timestamp without time zone) AND (userid = 22,519,958) AND (status = 101))
16. 2.532 2.532 ↓ 1.3 4 1

Index Only Scan using orders_2020_06_i_order_u_s_i_c on orders_2020_06 (cost=0.56..8.91 rows=3 width=12) (actual time=1.959..2.532 rows=4 loops=1)

  • Index Cond: ((userid = 22,519,958) AND (status = 101) AND (creation_date >= '2020-06-27 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
17. 0.676 0.676 ↑ 3.4 7 1

Index Only Scan using orders_2020_07_i_order_u_s_i_c on orders_2020_07 (cost=0.56..9.10 rows=24 width=12) (actual time=0.673..0.676 rows=7 loops=1)

  • Index Cond: ((userid = 22,519,958) AND (status = 101) AND (creation_date >= '2020-06-27 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
18. 0.005 0.005 ↓ 0.0 0 1

Index Scan using orders_2020_08_i_orders_user_status_inv_statusdt on orders_2020_08 (cost=0.14..8.16 rows=1 width=12) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((userid = 22,519,958) AND (status = 101))
  • Filter: (creation_date >= '2020-06-27 00:00:00'::timestamp without time zone)
Planning time : 41.907 ms
Execution time : 269,058.137 ms