explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SMmC0

Settings
# exclusive inclusive rows x rows loops node
1. 455.802 64,244.758 ↓ 3,287.8 657,553 1

Unique (cost=34,955,382,521.42..35,185,121,492.93 rows=200 width=247) (actual time=63,101.285..64,244.758 rows=657,553 loops=1)

  • Output: calls129.setup_time, calls129.cli, calls129.cld, cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, (CASE WHEN (dest.prefix IS NULL) THEN cdrs129.prefix ELSE dest.prefix END), (length((dest.prefix)::text))
2. 5,433.379 63,788.956 ↑ 45,925.3 1,000,490 1

Sort (cost=34,955,382,521.42..35,070,252,007.17 rows=45,947,794,302 width=247) (actual time=63,101.283..63,788.956 rows=1,000,490 loops=1)

  • Output: calls129.setup_time, calls129.cli, calls129.cld, cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, (CASE WHEN (dest.prefix IS NULL) THEN cdrs129.prefix ELSE dest.prefix END), (length((dest.prefix)::text))
  • Sort Key: cdrs129.i_cdr, (length((dest.prefix)::text)) DESC
  • Sort Method: external sort Disk: 185640kB
3. 1,706.329 58,355.577 ↑ 45,925.3 1,000,490 1

Nested Loop (cost=52.83..120,013,088.75 rows=45,947,794,302 width=247) (actual time=321.312..58,355.577 rows=1,000,490 loops=1)

  • Output: calls129.setup_time, calls129.cli, calls129.cld, cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, CASE WHEN (dest.prefix IS NULL) THEN cdrs129.prefix ELSE dest.prefix END, length((dest.prefix)::text)
4. 23,224.933 37,425.648 ↑ 1.6 1,130,800 1

Nested Loop Left Join (cost=52.41..680,655.28 rows=1,859,654 width=144) (actual time=0.581..37,425.648 rows=1,130,800 loops=1)

  • Output: cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, cdrs129.i_call, dest.prefix
5. 638.290 3,770.001 ↓ 4.0 745,051 1

Hash Join (cost=51.88..61,379.98 rows=186,244 width=138) (actual time=0.310..3,770.001 rows=745,051 loops=1)

  • Output: cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, cdrs129.i_call
  • Hash Cond: (cdrs129.i_account = accounts_1.i_account)
6. 677.604 3,131.589 ↓ 2.0 745,051 1

Hash Join (cost=26.08..58,448.78 rows=372,488 width=146) (actual time=0.167..3,131.589 rows=745,051 loops=1)

  • Output: cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, cdrs129.i_call, accounts.i_account
  • Hash Cond: (cdrs129.i_account = accounts.i_account)
7. 172.595 2,453.893 ↓ 1.0 745,051 1

Append (cost=0.29..52,612.16 rows=744,977 width=137) (actual time=0.048..2,453.893 rows=745,051 loops=1)

8. 36.394 36.394 ↑ 1.0 16,007 1

Index Scan using cdrs129_i_call on public.cdrs129 (cost=0.29..1,160.13 rows=16,127 width=139) (actual time=0.048..36.394 rows=16,007 loops=1)

  • Output: cdrs129.i_account, cdrs129.cost, cdrs129.connect_time, cdrs129.disconnect_time, cdrs129.duration, cdrs129.cli_in, cdrs129.cld_in, cdrs129.billed_duration, cdrs129.result, cdrs129.i_cdr, cdrs129.delay, cdrs129.price_1, cdrs129.price_n, cdrs129.prefix, cdrs129.remote_ip, cdrs129.i_call
  • Filter: (cdrs129.duration > '0'::double precision)
9. 50.481 50.481 ↓ 1.0 18,696 1

Index Scan using cdrs130_i_call on public.cdrs130 (cost=0.29..1,335.99 rows=18,583 width=138) (actual time=0.040..50.481 rows=18,696 loops=1)

  • Output: cdrs130.i_account, cdrs130.cost, cdrs130.connect_time, cdrs130.disconnect_time, cdrs130.duration, cdrs130.cli_in, cdrs130.cld_in, cdrs130.billed_duration, cdrs130.result, cdrs130.i_cdr, cdrs130.delay, cdrs130.price_1, cdrs130.price_n, cdrs130.prefix, cdrs130.remote_ip, cdrs130.i_call
  • Filter: (cdrs130.duration > '0'::double precision)
10. 1,325.840 1,325.840 ↑ 1.0 424,262 1

Index Scan using cdrs12_i_call on public.cdrs12 (cost=0.42..29,889.95 rows=424,306 width=138) (actual time=0.128..1,325.840 rows=424,262 loops=1)

  • Output: cdrs12.i_account, cdrs12.cost, cdrs12.connect_time, cdrs12.disconnect_time, cdrs12.duration, cdrs12.cli_in, cdrs12.cld_in, cdrs12.billed_duration, cdrs12.result, cdrs12.i_cdr, cdrs12.delay, cdrs12.price_1, cdrs12.price_n, cdrs12.prefix, cdrs12.remote_ip, cdrs12.i_call
  • Filter: (cdrs12.duration > '0'::double precision)
11. 868.583 868.583 ↓ 1.0 286,086 1

Index Scan using cdrs132_i_call on public.cdrs132 (cost=0.42..20,226.09 rows=285,961 width=136) (actual time=0.050..868.583 rows=286,086 loops=1)

  • Output: cdrs132.i_account, cdrs132.cost, cdrs132.connect_time, cdrs132.disconnect_time, cdrs132.duration, cdrs132.cli_in, cdrs132.cld_in, cdrs132.billed_duration, cdrs132.result, cdrs132.i_cdr, cdrs132.delay, cdrs132.price_1, cdrs132.price_n, cdrs132.prefix, cdrs132.remote_ip, cdrs132.i_call
  • Filter: (cdrs132.duration > '0'::double precision)
12. 0.020 0.092 ↑ 1.0 81 1

Hash (cost=24.78..24.78 rows=81 width=8) (actual time=0.092..0.092 rows=81 loops=1)

  • Output: accounts.i_account
  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
13. 0.046 0.072 ↑ 1.0 81 1

Bitmap Heap Scan on public.accounts (cost=8.77..24.78 rows=81 width=8) (actual time=0.032..0.072 rows=81 loops=1)

  • Output: accounts.i_account
  • Recheck Cond: (accounts.i_customer = '1'::bigint)
  • Heap Blocks: exact=15
14. 0.026 0.026 ↑ 1.0 81 1

Bitmap Index Scan on accounts_i_customer (cost=0.00..8.75 rows=81 width=0) (actual time=0.026..0.026 rows=81 loops=1)

  • Index Cond: (accounts.i_customer = '1'::bigint)
15. 0.030 0.122 ↑ 1.0 81 1

Hash (cost=24.78..24.78 rows=81 width=8) (actual time=0.122..0.122 rows=81 loops=1)

  • Output: accounts_1.i_account
  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
16. 0.062 0.092 ↑ 1.0 81 1

Bitmap Heap Scan on public.accounts accounts_1 (cost=8.77..24.78 rows=81 width=8) (actual time=0.038..0.092 rows=81 loops=1)

  • Output: accounts_1.i_account
  • Recheck Cond: (accounts_1.i_customer = '1'::bigint)
  • Heap Blocks: exact=15
17. 0.030 0.030 ↑ 1.0 81 1

Bitmap Index Scan on accounts_i_customer (cost=0.00..8.75 rows=81 width=0) (actual time=0.030..0.030 rows=81 loops=1)

  • Index Cond: (accounts_1.i_customer = '1'::bigint)
18. 10,430.714 10,430.714 ↑ 5.0 2 745,051

Index Only Scan using destinations_prefix2 on public.destinations dest (cost=0.53..3.23 rows=10 width=6) (actual time=0.008..0.014 rows=2 loops=745,051)

  • Output: dest.prefix
  • Index Cond: (dest.prefix = ANY ((prefixes(cdrs129.prefix))::text[]))
  • Heap Fetches: 0
19. 2,261.600 19,223.600 ↑ 4.0 1 1,130,800

Append (cost=0.42..2.36 rows=4 width=39) (actual time=0.014..0.017 rows=1 loops=1,130,800)

20. 3,392.400 3,392.400 ↓ 0.0 0 1,130,800

Index Scan using calls129_pkey on public.calls129 (cost=0.42..0.46 rows=1 width=39) (actual time=0.003..0.003 rows=0 loops=1,130,800)

  • Output: calls129.setup_time, calls129.cli, calls129.cld, calls129.i_call
  • Index Cond: (calls129.i_call = cdrs129.i_call)
  • Filter: ((calls129.setup_time >= '2018-12-31 00:00:00+00'::timestamp with time zone) AND (calls129.setup_time <= '2019-01-03 11:29:12+00'::timestamp with time zone))
  • Rows Removed by Filter: 0
21. 3,392.400 3,392.400 ↓ 0.0 0 1,130,800

Index Scan using calls130_pkey on public.calls130 (cost=0.42..0.48 rows=1 width=39) (actual time=0.003..0.003 rows=0 loops=1,130,800)

  • Output: calls130.setup_time, calls130.cli, calls130.cld, calls130.i_call
  • Index Cond: (calls130.i_call = cdrs129.i_call)
  • Filter: ((calls130.setup_time >= '2018-12-31 00:00:00+00'::timestamp with time zone) AND (calls130.setup_time <= '2019-01-03 11:29:12+00'::timestamp with time zone))
22. 5,654.000 5,654.000 ↑ 1.0 1 1,130,800

Index Scan using calls12_pkey on public.calls12 (cost=0.43..0.78 rows=1 width=39) (actual time=0.005..0.005 rows=1 loops=1,130,800)

  • Output: calls12.setup_time, calls12.cli, calls12.cld, calls12.i_call
  • Index Cond: (calls12.i_call = cdrs129.i_call)
  • Filter: ((calls12.setup_time >= '2018-12-31 00:00:00+00'::timestamp with time zone) AND (calls12.setup_time <= '2019-01-03 11:29:12+00'::timestamp with time zone))
23. 4,523.200 4,523.200 ↓ 0.0 0 1,130,800

Index Scan using calls132_pkey on public.calls132 (cost=0.43..0.63 rows=1 width=40) (actual time=0.004..0.004 rows=0 loops=1,130,800)

  • Output: calls132.setup_time, calls132.cli, calls132.cld, calls132.i_call
  • Index Cond: (calls132.i_call = cdrs129.i_call)
  • Filter: ((calls132.setup_time >= '2018-12-31 00:00:00+00'::timestamp with time zone) AND (calls132.setup_time <= '2019-01-03 11:29:12+00'::timestamp with time zone))
  • Rows Removed by Filter: 0