Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(core-database-postgres): add sender&receiver indexes #1638

Merged
merged 1 commit into from
Dec 4, 2018

Commits on Dec 4, 2018

  1. perf(core-database-postgres): add sender&receiver indexes

    Add indexes on transactions's sender_public_key and recipient_id
    columns.
    
    Impact on queries:
    
    SELECT count(*) AS count FROM transactions WHERE
    sender_public_key = '... many matches ...' OR
    recipient_id = '... many matches ...';
    ~230ms -> 230ms (no change)
    
    SELECT count(*) AS count FROM transactions WHERE
    sender_public_key = '... many matches ...' OR
    recipient_id = '... few matches ...';
    ~230ms -> 90ms
    
    SELECT count(*) AS count FROM transactions WHERE
    sender_public_key = '... few matches ...' OR
    recipient_id = '... many matches ...';
    ~230ms -> 70ms
    
    SELECT count(*) AS count FROM transactions WHERE
    sender_public_key = '... few matches ...' OR
    recipient_id = '... few matches ...';
    ~230ms -> 50ms
    vasild committed Dec 4, 2018
    Configuration menu
    Copy the full SHA
    eda7e6d View commit details
    Browse the repository at this point in the history