explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hiOF : 1

Settings
# exclusive inclusive rows x rows loops node
1. 0.328 2,535.251 ↑ 1.0 1 1

Aggregate (cost=55,472.94..55,472.95 rows=1 width=8) (actual time=2,535.251..2,535.251 rows=1 loops=1)

  • Output: count(*)
  • Buffers: shared hit=1267741
2. 0.211 2,534.923 ↓ 44.1 309 1

Nested Loop (cost=54,596.08..55,472.93 rows=7 width=0) (actual time=802.632..2,534.923 rows=309 loops=1)

  • Buffers: shared hit=1267741
3. 0.027 0.027 ↑ 1.0 1 1

Seq Scan on ips_paylogger_service.payment_status_mapping m (cost=0.00..1.20 rows=1 width=4) (actual time=0.023..0.027 rows=1 loops=1)

  • Output: m.id, m.sbp_message_type, m.sbp_processing_step, m.business_status
  • Filter: ((m.sbp_message_type)::text = 'C22'::text)
  • Rows Removed by Filter: 15
  • Buffers: shared hit=1
4. 101.785 2,534.685 ↓ 44.1 309 1

Nested Loop (cost=54,596.08..55,471.66 rows=7 width=4) (actual time=802.606..2,534.685 rows=309 loops=1)

  • Output: p.sbp_message_type
  • Inner Unique: true
  • Buffers: shared hit=1267740
5. 244.841 898.125 ↓ 1,534.8 306,955 1

HashAggregate (cost=54,595.66..54,597.66 rows=200 width=8) (actual time=776.614..898.125 rows=306,955 loops=1)

  • Output: (max(payment.id))
  • Group Key: max(payment.id)
  • Buffers: shared hit=38228
6. 372.114 653.284 ↓ 1.3 306,955 1

HashAggregate (cost=49,399.51..51,708.91 rows=230,940 width=16) (actual time=561.885..653.284 rows=306,955 loops=1)

  • Output: payment.ips_transaction_id, max(payment.id)
  • Group Key: payment.ips_transaction_id
  • Buffers: shared hit=38228
7. 281.170 281.170 ↑ 1.0 744,622 1

Seq Scan on ips_paylogger_service.payment (cost=0.00..45,675.67 rows=744,767 width=16) (actual time=0.007..281.170 rows=744,622 loops=1)

  • Output: payment.id, payment.event_datetime, payment.ips_transaction_id, payment.sbp_transaction_type, payment.sbp_message_type, payment.transaction_status, payment.result_code, payment.ips_result_message, payment.sbp_transaction_id, payment.sender_bank_message_id, payment.receiver_bank_message_id, payment.sbp_message_id, payment.cnum, payment.sender_bank_message_datetime, payment.receiver_bank_message_datetime, payment.sbp_message_creation_datatime, payment.sbp_id, payment.target_bank_id, payment.payment_amount, payment.payment_currency, payment.fee_amount, payment.fee_currency, payment.payment_description, payment.sender_bank_id, payment.sender_bank_bik, payment.sender_bank_rus, payment.sender_id_type, payment.sender_id_value, payment.sender_full_name, payment.sender_pam, payment.sender_account_number, payment.sender_account_type, payment.sender_address, payment.sender_document_number, payment.sender_document_type, payment.sender_tin, payment.receiver_bank_id, payment.receiver_bank_bik, payment.receiver_bank_rus, payment.receiver_id_type, payment.receiver_id_value, payment.receiver_full_name, payment.receiver_pam, payment.receiver_account_number, payment.receiver_account_type, payment.receiver_address, payment.receiver_document_number, payment.receiver_document_type, payment.receiver_tin, payment.spb_transaction_datetime, payment.spb_transaction_control_value, payment.spb_reference_transaction_id, payment.transaction_oper_day, payment.sbp_message_scheme, payment.sbp_suspicious_transaction_id, payment.transaction_cancellation_original_id, payment.transaction_cancellation_reason, payment.transaction_cancellation_debit_credit_flag, payment.cig_account_info_fma_number, payment.cig_account_info_cb_number, payment.cig_account_info_account_type, payment.cig_account_info_inactive, payment.cig_account_info_currency, payment.cig_account_info_block_debit, payment.cig_account_info_block_credit, payment.cig_account_info_balance_before_hold, payment.cig_account_info_calculated_balance, payment.cig_hold_payment_id, payment.cig_hold_payment_cb_number, payment.cig_hold_payment_amount, payment.cig_hold_payment_priority, payment.cig_hold_payment_requirement_type, payment.cig_hold_payment_narrative, payment.cig_hold_payment_extended_narrative, payment.cig_hold_payment_external_reference, payment.cig_hold_payment_operation_subtype, payment.cig_hold_fee_id, payment.cig_hold_fee_cb_number, payment.cig_hold_fee_amount, payment.cig_hold_fee_priority, payment.cig_hold_fee_requirement_type, payment.cig_hold_fee_narrative, payment.cig_hold_fee_extended_narrative, payment.cig_hold_fee_external_reference, payment.cig_hold_fee_operation_subtype, payment.cig_payment_transaction_id, payment.cig_payment_hold_id, payment.cig_payment_operation_subtype, payment.cig_payment_document_number, payment.cig_payment_statement_narrative, payment.cig_payment_external_reference, payment.cig_payment_debit_account_number, payment.cig_payment_debit_transaction_type, payment.cig_payment_debit_payment_amount, payment.cig_payment_debit_narrative, payment.cig_payment_debit_profit_center, payment.cig_payment_debit_extended_narrative, payment.cig_payment_credit_account_number, payment.cig_payment_credit_transaction_type, payment.cig_payment_credit_payment_amount, payment.cig_payment_credit_narrative, payment.cig_payment_credit_profit_center, payment.cig_payment_credit_extended_narrative, payment.cig_fee_transaction_id, payment.cig_fee_hold_id, payment.cig_fee_operation_subtype, payment.cig_fee_document_number, payment.cig_fee_statement_narrative, payment.cig_fee_external_reference, payment.cig_fee_debit_account_number, payment.cig_fee_debit_transaction_type, payment.cig_fee_debit_payment_amount, payment.cig_fee_debit_narrative, payment.cig_fee_debit_profit_center, payment.cig_fee_debit_extended_narrative, payment.cig_fee_credit_account_number, payment.cig_fee_credit_transaction_type, payment.cig_fee_credit_payment_amount, payment.cig_fee_credit_narrative, payment.cig_fee_credit_profit_center, payment.cig_fee_credit_extended_narrative
  • Buffers: shared hit=38228
8. 1,534.775 1,534.775 ↓ 0.0 0 306,955

Index Scan using payment_pkey on ips_paylogger_service.payment p (cost=0.42..4.37 rows=1 width=12) (actual time=0.005..0.005 rows=0 loops=306,955)

  • Output: p.id, p.event_datetime, p.ips_transaction_id, p.sbp_transaction_type, p.sbp_message_type, p.transaction_status, p.result_code, p.ips_result_message, p.sbp_transaction_id, p.sender_bank_message_id, p.receiver_bank_message_id, p.sbp_message_id, p.cnum, p.sender_bank_message_datetime, p.receiver_bank_message_datetime, p.sbp_message_creation_datatime, p.sbp_id, p.target_bank_id, p.payment_amount, p.payment_currency, p.fee_amount, p.fee_currency, p.payment_description, p.sender_bank_id, p.sender_bank_bik, p.sender_bank_rus, p.sender_id_type, p.sender_id_value, p.sender_full_name, p.sender_pam, p.sender_account_number, p.sender_account_type, p.sender_address, p.sender_document_number, p.sender_document_type, p.sender_tin, p.receiver_bank_id, p.receiver_bank_bik, p.receiver_bank_rus, p.receiver_id_type, p.receiver_id_value, p.receiver_full_name, p.receiver_pam, p.receiver_account_number, p.receiver_account_type, p.receiver_address, p.receiver_document_number, p.receiver_document_type, p.receiver_tin, p.spb_transaction_datetime, p.spb_transaction_control_value, p.spb_reference_transaction_id, p.transaction_oper_day, p.sbp_message_scheme, p.sbp_suspicious_transaction_id, p.transaction_cancellation_original_id, p.transaction_cancellation_reason, p.transaction_cancellation_debit_credit_flag, p.cig_account_info_fma_number, p.cig_account_info_cb_number, p.cig_account_info_account_type, p.cig_account_info_inactive, p.cig_account_info_currency, p.cig_account_info_block_debit, p.cig_account_info_block_credit, p.cig_account_info_balance_before_hold, p.cig_account_info_calculated_balance, p.cig_hold_payment_id, p.cig_hold_payment_cb_number, p.cig_hold_payment_amount, p.cig_hold_payment_priority, p.cig_hold_payment_requirement_type, p.cig_hold_payment_narrative, p.cig_hold_payment_extended_narrative, p.cig_hold_payment_external_reference, p.cig_hold_payment_operation_subtype, p.cig_hold_fee_id, p.cig_hold_fee_cb_number, p.cig_hold_fee_amount, p.cig_hold_fee_priority, p.cig_hold_fee_requirement_type, p.cig_hold_fee_narrative, p.cig_hold_fee_extended_narrative, p.cig_hold_fee_external_reference, p.cig_hold_fee_operation_subtype, p.cig_payment_transaction_id, p.cig_payment_hold_id, p.cig_payment_operation_subtype, p.cig_payment_document_number, p.cig_payment_statement_narrative, p.cig_payment_external_reference, p.cig_payment_debit_account_number, p.cig_payment_debit_transaction_type, p.cig_payment_debit_payment_amount, p.cig_payment_debit_narrative, p.cig_payment_debit_profit_center, p.cig_payment_debit_extended_narrative, p.cig_payment_credit_account_number, p.cig_payment_credit_transaction_type, p.cig_payment_credit_payment_amount, p.cig_payment_credit_narrative, p.cig_payment_credit_profit_center, p.cig_payment_credit_extended_narrative, p.cig_fee_transaction_id, p.cig_fee_hold_id, p.cig_fee_operation_subtype, p.cig_fee_document_number, p.cig_fee_statement_narrative, p.cig_fee_external_reference, p.cig_fee_debit_account_number, p.cig_fee_debit_transaction_type, p.cig_fee_debit_payment_amount, p.cig_fee_debit_narrative, p.cig_fee_debit_profit_center, p.cig_fee_debit_extended_narrative, p.cig_fee_credit_account_number, p.cig_fee_credit_transaction_type, p.cig_fee_credit_payment_amount, p.cig_fee_credit_narrative, p.cig_fee_credit_profit_center, p.cig_fee_credit_extended_narrative
  • Index Cond: (p.id = (max(payment.id)))
  • Filter: (((p.sbp_message_type)::text = 'C22'::text) AND ((p.result_code)::text = 'P00000'::text) AND (date(p.event_datetime) >= CURRENT_DATE))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1229512