explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MXs1x

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 4,356.958 ↑ 3.6 8 1

GroupAggregate (cost=268,297.37..268,298.02 rows=29 width=44) (actual time=4,356.955..4,356.958 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 4,356.950 ↑ 2.6 11 1

Sort (cost=268,297.37..268,297.44 rows=29 width=36) (actual time=4,356.949..4,356.950 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.006 4,356.921 ↑ 2.6 11 1

Nested Loop (cost=24.31..268,296.67 rows=29 width=36) (actual time=2,453.471..4,356.921 rows=11 loops=1)

4. 0.004 4,356.808 ↑ 1.0 1 1

Nested Loop (cost=24.31..268,227.14 rows=1 width=16) (actual time=2,453.395..4,356.808 rows=1 loops=1)

5. 3,648.389 4,356.778 ↑ 1.0 1 1

Hash Right Join (cost=23.88..268,218.67 rows=1 width=12) (actual time=2,453.367..4,356.778 rows=1 loops=1)

  • Hash Cond: (replace(replace((cpf_receita_federals.cpf)::text, '.'::text, ''::text), '-'::text, ''::text) = (documents.document)::text)
6. 708.281 708.281 ↑ 1.0 8,469,221 1

Seq Scan on cpf_receita_federals (cost=0.00..215,145.25 rows=8,487,925 width=23) (actual time=0.006..708.281 rows=8,469,221 loops=1)

7. 0.074 0.108 ↑ 1.0 1 1

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

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

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

9. 0.001 0.025 ↑ 1.0 1 1

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

10. 0.014 0.014 ↑ 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.013..0.014 rows=1 loops=1)

  • Index Cond: (userid = 22,519,958)
11. 0.010 0.010 ↑ 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.009..0.010 rows=1 loops=1)

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

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

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

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

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

Append (cost=0.00..69.17 rows=29 width=12) (actual time=0.072..0.107 rows=11 loops=1)

15. 0.041 0.041 ↓ 0.0 0 1

Seq Scan on orders (cost=0.00..19.00 rows=1 width=12) (actual time=0.041..0.041 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. 0.033 0.033 ↓ 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=0.031..0.033 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.024 0.024 ↑ 3.4 7 1

Index Only Scan using orders_2020_07_i_order_u_s_i_c on orders_2020_07 (cost=0.56..33.10 rows=24 width=12) (actual time=0.019..0.024 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: 1
18. 0.008 0.008 ↓ 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.008..0.008 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 : 42.118 ms
Execution time : 4,357.195 ms