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

DB Index is created over ergoTreeTemplate which is being created for all ergoTrees instead of just P2PK #252

Open
pragmaxim opened this issue Jun 25, 2023 · 1 comment

Comments

@pragmaxim
Copy link

Hi,

This might improve performance a lot in both query time and indexing time.

Problem :

@pragmaxim
Copy link
Author

pragmaxim commented Jun 26, 2023

I overlooked that the index is already skipping the FeeContract https://github.com/ergoplatform/explorer-backend/blob/master/modules/explorer-core/src/main/resources/db/V9__Schema.sql#L153 WHERE NOT ergo_tree_template_hash = 'd19683030193a38cc7b2a57300000193c2b2a57301007473027303830108cdeeac93b1a57304'; This should be done even for any P2PK as they all have the same template

Ideally storing NULL in these cases and then do :

CREATE INDEX "node_outputs__ergo_tree_template_hash" ON node_outputs (ergo_tree_template_hash)
    WHERE ergo_tree_template_hash IS NOT NULL;

@pragmaxim pragmaxim reopened this Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant