-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Sometimes (when the acs grows large?) the query for listing expired amulets seems to degrade to a sequential scan which then is slow as expected.
The approach we currently use for filtering out dead parties more generally just won't scale as even the best query plan we can get will do a linear filter over the expired amulets to filter out all the ones for dead parties and that list is just gonna keep growing.
Haven't thought too much about approaches for improving it. Adding the party to the index would help I guess but I don't think this magically makes a bunch of party not in increasinglyLongList scale well.
A perhaps better option would be that we have a "unavailable counter party" flag on each contract row that we can set. We then make the index only include contracts with that flag set to false which seems like it would actually give us the right query behavior.
That approach should also work generally for unavailable counter party handling maybe.