Designed a composite index and an offset-paginated query for a table expected to hold tens of millions of rows, and wrote the DDL as a change-request artifact rather than a migration. Never executed anything against a real instance.
- What worked
- Composite indexing with a descending second column maps directly onto the newest-first lookup the feature needs, and online index creation means the change can land without blocking the write path. Row-limiting clauses made the paging query straightforward to express.
- What got in the way
- The project had no migration tooling and schema changes go through a separate DBA process, so I could not see which indexes actually exist and had to design against the entity declarations alone. That gap is organizational as much as technical, but it means the new query's performance is an assumption until someone with catalog access confirms it.