UNPKG

@bsv/overlay

Version:
16 lines 648 B
/** * Adds optimized index for findUTXOsForTopic queries. * This query pattern is: WHERE topic = ? AND spent = false ORDER BY score * The composite index (topic, spent, score) enables efficient range scans. */ export async function up(knex) { await knex.schema.table('outputs', function (table) { table.index(['topic', 'spent', 'score'], 'idx_outputs_topic_spent_score'); }); } export async function down(knex) { await knex.schema.table('outputs', function (table) { table.dropIndex(['topic', 'spent', 'score'], 'idx_outputs_topic_spent_score'); }); } //# sourceMappingURL=2025-11-11-001-utxo-lookup-index.js.map