fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

Cascades should match record type key field with record type restrictions

Open alecgrieser opened this issue 1 year ago • 0 comments

The Cascades planner currently doesn't match record type keys at all during planning. This can be a problem for operations like querying for a single type when the primary key is prefixed by the record type key. In that case, we'd want a query equivalent to SELECT * FROM aTable to be executed by a scanning just the records of that type:

Scan([IS aTable])

(Which is how the old planner plans such a query.) Instead, the planner doesn't match the record type key, and so the plan is executed as:

Scan(<,>) | [aTable]

That is, as a full scan with a type-filter on aTable after it.

alecgrieser avatar May 02 '23 13:05 alecgrieser