-- Performance indexes for frequently queried fields
ALTER TABLE custom_ledger_accounts ADD INDEX idx_code_category (code, category);
ALTER TABLE custom_ledger_accounts ADD INDEX idx_extra_currency (extra->'$.currency_code');

-- Add indexes for other common queries
ALTER TABLE agents ADD INDEX idx_status (status);
ALTER TABLE transfers ADD INDEX idx_status_created (status, created_at);
ALTER TABLE users ADD INDEX idx_email (email);

-- Composite indexes for better performance
ALTER TABLE custom_ledger_accounts ADD INDEX idx_code_category_extra (code, category, extra->'$.currency_code');
