explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kRPy : explain select b.whitelabel_id as whitelabel_id, b.whitelabel_name as whitelabel_name, count(case when a.tran_status = 'RF' and a.is_allow_refund = 0 then transaction_id else null end) as total_REFUNDED, sum(case when a.tran_status = 'RF' and a.is_allow_refund = 0 then tran_amount else 0 end) as total_REFUNDED_amount , count(case when a.tran_status = 'F' and a.is_allow_refund = 1 then transaction_id else null end) as total_enabled_RF_and_failed, sum(case when a.tran_status = 'F' and a.is_allow_refund = 1 then tran_amount else 0 end) as total_failed_rf_enabled_amount, count(*) as total_enabled_RF_and_failed, sum(tran_amount) from transaction as a inner join whitelabel_master as b on a.white_label_id = b.whitelabel_id where date(a.transaction_on) = date(now()) and a.white_label_id >= 0 group by a.white_label_id,b.whitelabel_id

Settings
# exclusive inclusive rows x rows loops node
1. 0.158 55.012 ↑ 11.4 71 1

Sort (cost=146.63..148.65 rows=808 width=138) (actual time=55.009..55.012 rows=71 loops=1)

  • Sort Key: n.nspname, p.proname, (pg_get_function_arguments(p.oid))
  • Sort Method: quicksort Memory: 43kB
2. 1.378 54.854 ↑ 11.4 71 1

Hash Join (cost=1.14..107.61 rows=808 width=138) (actual time=42.495..54.854 rows=71 loops=1)

  • Hash Cond: (p.pronamespace = n.oid)
3. 53.465 53.465 ↓ 3.0 2,402 1

Seq Scan on pg_proc p (cost=0.00..89.30 rows=808 width=78) (actual time=0.052..53.465 rows=2,402 loops=1)

  • Filter: pg_function_is_visible(oid)
4. 0.004 0.011 ↑ 1.0 4 1

Hash (cost=1.09..1.09 rows=4 width=68) (actual time=0.011..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
5. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on pg_namespace n (cost=0.00..1.09 rows=4 width=68) (actual time=0.005..0.007 rows=4 loops=1)

  • Filter: ((nspname <> 'pg_catalog'::name) AND (nspname <> 'information_schema'::name))