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

minor optimization for paranet_synced_asset table, ual index #3369

Open
botnumberseven opened this issue Oct 28, 2024 · 0 comments
Open

minor optimization for paranet_synced_asset table, ual index #3369

botnumberseven opened this issue Oct 28, 2024 · 0 comments

Comments

@botnumberseven
Copy link

botnumberseven commented Oct 28, 2024

During paranet sync process node execute a lot of queries like this (see below).

I've added index below and it helped to reduce time for these SELECT to complete, as well as resource consumption a bit.
ALTER TABLE paranet_synced_asset ADD INDEX idx_ual (ual);

SELECT
id
, blockchain_id AS blockchainId
, ual
, paranet_ual AS paranetUal
, public_assertion_id AS publicAssertionId
, private_assertion_id AS privateAssertionId
, sender
, transaction_hash AS transactionHash
, data_source AS dataSource
, created_at AS createdAt
, updated_at AS updatedAt
FROM paranet_synced_asset AS paranet_synced_asset
WHERE paranet_synced_asset.ual = 'did:dkg:base:84532/0xb8b904c73d2fb4d8c173298a51c27fab70222c32/6239745'
LIMIT 1

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