Skip to content

Conversation

nicov-iov
Copy link
Collaborator

@nicov-iov nicov-iov commented Aug 12, 2025

This pull request updates the RSK Explorer database schema and Prisma models to improve query performance and consistency. The main changes are the addition of several composite and unique indexes across key tables, a fix to a column naming inconsistency, and alignment between the SQL schema and Prisma models.

Indexing improvements for performance:

  • Added composite indexes to the balance table for (address, id) and (address, block_number) to speed up lookups by address and block context. [1] [2]
  • Added composite indexes to the event table for (address, event, event_id) and for (event), improving event query efficiency. [1] [2]
  • Added a unique index and several composite indexes to the transaction table for (block_number, transaction_index) in various sort orders, improving transaction retrieval and ensuring uniqueness. [1] [2] [3]
  • Added indexes to the verification_result table on address and match columns to improve contract verification queries. [1] [2]

Schema consistency and naming fixes:

  • Standardized the is_successful column name in the transaction table and Prisma model (was previously isSuccessful in some places), ensuring consistency between the SQL schema and Prisma. [1] [2]

Prisma model alignment:

  • Updated the Prisma schema to match the new indexes and column names in the SQL schema, including the reordering of fields and index definitions for balance, event, transaction, and verification_result models. [1] [2] [3] [4] [5]

These changes will make queries more efficient and maintainable, and ensure the Prisma models accurately reflect the underlying database schema.

@nicov-iov nicov-iov requested a review from ivegabr August 12, 2025 19:24
Copy link

github-actions bot commented Aug 12, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@nicov-iov nicov-iov force-pushed the refactor/DV-1088-update-database-schema branch from aaa172e to 352aecf Compare August 12, 2025 19:56
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

Successfully merging this pull request may close these issues.

1 participant