drepquery

package
v0.71.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionArgs

func CollectionArgs(values any, expiryEpoch uint64) []any

CollectionArgs returns the bind order shared by batch and by-type queries: inner expiry, inner collection, outer expiry, outer collection.

func VotingPowerBatchSQL

func VotingPowerBatchSQL(dialectName string, expiryEpoch uint64) string

VotingPowerBatchSQL builds the aggregate credential voting-power query.

func VotingPowerByTypeSQL

func VotingPowerByTypeSQL(dialectName string, expiryEpoch uint64) string

VotingPowerByTypeSQL builds the predefined-DRep voting-power query. The inner subquery starts from the small, indexed set of accounts delegated to the requested drep_type(s) and joins outward to utxo (the account-first shape VotingPowerBatchSQL already uses), instead of scanning every live utxo row and probing account with a correlated EXISTS per row. See blinklabs-io/dingo#4364: on a live preview node with 2.86M live utxo rows and ~4,610 drep-delegated accounts, the correlated-EXISTS shape cost 620-650ms per call versus 16-35ms for this shape, with byte-identical results.

func VotingPowerSQL

func VotingPowerSQL(
	dialectName string,
	credentialTag uint8,
	drepCredential []byte,
	expiryEpoch uint64,
) (string, []any)

VotingPowerSQL builds the single-credential voting-power query and its bind arguments in textual order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL