d5f4d807d7
This enhancement optimizes the schema migration process for the event index by preventing the redundant execution of Data Definition Language (DDL) statements that define the event schema. Traditionally, these DDL statements were grouped into a single slice, reflecting the most current version of the event index schema. With each migration, this slice was updated to the latest schema iteration, executing all statements in bulk. Initially, this method sufficed as migrations were focused on adding indices to existing table columns. However, as the database schema evolves to meet new requirements, such as the forthcoming migrations that involve changes to table schemas (notably, indexing events by emitter actor ID instead of addresses), the prior approach of bulk execution of DDL statements becomes unsuitable: it will no longer be safe to repeatedly execute DDL statements in previous migrations, because the upcoming one changes `event` table column structure. To address this issue, the work here has isolated the event index schema migrations on a per-version basis. This adjustment ensures that only the necessary DDL statements are executed during each migration, avoiding the inefficiencies and potential errors associated with redundant executions. The work here should also minimize the refactoring required for future migrations, facilitating a smoother introduction of significant schema updates. |
||
---|---|---|
.. | ||
filter | ||
state | ||
cache.go | ||
events_called.go | ||
events_height.go | ||
events_test.go | ||
events.go | ||
message_cache.go | ||
observer.go | ||
tscache_test.go | ||
tscache.go | ||
utils.go |