explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 20Pd

Settings
# exclusive inclusive rows x rows loops node
1. 27.893 122,081.891 ↑ 1.3 41,726 1

Sort (cost=10,032,529.20..10,032,664.19 rows=53,996 width=492) (actual time=122,074.933..122,081.891 rows=41,726 loops=1)

  • Sort Key: store_item_health_authority_code_type_view.ha_code_type_id
  • Sort Method: external merge Disk: 2464kB
2. 6.309 122,053.998 ↑ 1.3 41,726 1

Subquery Scan on store_item_health_authority_code_type_view (cost=10,003,614.01..10,004,288.96 rows=53,996 width=492) (actual time=121,986.505..122,053.998 rows=41,726 loops=1)

3. 192.631 122,047.689 ↑ 1.3 41,726 1

Sort (cost=10,003,614.01..10,003,749.00 rows=53,996 width=57) (actual time=121,986.504..122,047.689 rows=41,726 loops=1)

  • Sort Key: store_item_details.medicine_name
  • Sort Method: external merge Disk: 2680kB
4. 11.862 121,855.058 ↑ 1.3 41,726 1

Unique (cost=9,996,526.33..9,997,336.27 rows=53,996 width=57) (actual time=121,809.070..121,855.058 rows=41,726 loops=1)

5. 293.446 121,843.196 ↑ 1.3 41,726 1

Sort (cost=9,996,526.33..9,996,661.32 rows=53,996 width=57) (actual time=121,809.070..121,843.196 rows=41,726 loops=1)

  • Sort Key: health_authority_master.health_authority, (NULL::integer), store_item_details.medicine_id, store_item_details.medicine_name, (''::character varying)
  • Sort Method: external merge Disk: 2688kB
6. 4.613 121,549.750 ↑ 1.3 41,726 1

Append (cost=0.00..9,990,248.59 rows=53,996 width=57) (actual time=16.722..121,549.750 rows=41,726 loops=1)

7. 17.771 121,512.780 ↓ 1.4 29,816 1

Nested Loop (cost=0.00..9,986,397.72 rows=20,876 width=49) (actual time=16.721..121,512.780 rows=29,816 loops=1)

8. 61,438.801 121,495.009 ↓ 1.4 14,908 1

Seq Scan on store_item_details (cost=0.00..9,986,135.75 rows=10,438 width=45) (actual time=16.701..121,495.009 rows=14,908 loops=1)

  • Filter: (NOT (SubPlan 1))
  • Rows Removed by Filter: 6076
9.          

SubPlan (for Seq Scan)

10. 60,049.759 60,056.208 ↑ 1.1 30,920 20,984

Materialize (cost=0.00..873.80 rows=33,120 width=4) (actual time=0.002..2.862 rows=30,920 loops=20,984)

11. 6.449 6.449 ↓ 1.0 33,121 1

Seq Scan on ha_item_code_type (cost=0.00..578.20 rows=33,120 width=4) (actual time=0.018..6.449 rows=33,121 loops=1)

12. 0.000 0.000 ↑ 1.0 2 14,908

Materialize (cost=0.00..1.03 rows=2 width=4) (actual time=0.000..0.000 rows=2 loops=14,908)

13. 0.011 0.011 ↑ 1.0 2 1

Seq Scan on health_authority_master (cost=0.00..1.02 rows=2 width=4) (actual time=0.011..0.011 rows=2 loops=1)

14. 15.323 32.357 ↑ 2.8 11,910 1

Hash Join (cost=1,537.71..3,310.91 rows=33,120 width=62) (actual time=19.609..32.357 rows=11,910 loops=1)

  • Hash Cond: (hict.medicine_id = sid.medicine_id)
15. 5.853 5.853 ↓ 1.0 33,121 1

Seq Scan on ha_item_code_type hict (cost=0.00..578.20 rows=33,120 width=21) (actual time=0.020..5.853 rows=33,121 loops=1)

16. 5.022 11.181 ↓ 1.0 20,984 1

Hash (cost=1,092.76..1,092.76 rows=20,876 width=45) (actual time=11.181..11.181 rows=20,984 loops=1)

  • Buckets: 2048 Batches: 2 Memory Usage: 800kB
17. 6.159 6.159 ↓ 1.0 20,984 1

Seq Scan on store_item_details sid (cost=0.00..1,092.76 rows=20,876 width=45) (actual time=0.010..6.159 rows=20,984 loops=1)

Total runtime : 122,085.567 ms