Support for validFrom app-data field - #4672
Conversation
|
Reminder: Please update the DB Readme and comment whether migrations are reversible (include rollback scripts if applicable).
Caused by: |
|
Reminder: Please consider backward compatibility when modifying the API specification.
Caused by: |
|
Claude finished @AryanGodara's task in 5m 0s —— View job PR Review: Support for
|
MartinquaXD
left a comment
There was a problem hiding this comment.
Also I'm a bit hesitant about the runtime of the new query. We are already adding an index for the new column but we should probably do a test run on the prod DB before merging this PR.
| WHERE ( | ||
| (o.creation_timestamp > $1 OR o.cancellation_timestamp > $1 OR o.uid = ANY($2)) | ||
| AND (o.valid_from IS NULL OR o.valid_from <= $3) | ||
| ) | ||
| OR (o.valid_from IS NOT NULL | ||
| AND o.valid_from > EXTRACT(EPOCH FROM $1)::bigint | ||
| AND o.valid_from <= $3) |
There was a problem hiding this comment.
Actually after thinking more about it it's not clear to me why we even split block based change detection from time based change detection. It seems like that could become 1 giant DB query. That way we save on roundtrips and possible help the query planner optimize better. 🤔
This would mean quite a change so it's out of scope for this PR.
Description
Add
validFrom(app-data, unix seconds). An order enters the batch auction only oncenow >= validFrom.NULL/absent = eligible immediately (unchanged for existing orders). Groundwork for fast-path.Changes
orders.valid_fromcolumn (V115) + partial index (V116), no backfill.valid_fromfrom app-data insideinsert_order_hooks(reusing the fetch it already does).validFrom >= validTo; a pastvalidFromis fine.Testing
Note:
Overlaps #4668, compared the two, fixed e2e tests accordingly, and removed some redundant unit tests, and focused the PR