Skip to content

Describe the planner type of a RecordType, including a synthetic one - #4829

Merged
g31pranjal merged 4 commits into
mainfrom
apple/g31pranjal/planner-type-for-record-type
Nov 3, 2026
Merged

g31pranjal merged 4 commits into
mainfrom
apple/g31pranjal/planner-type-for-record-type

Conversation

@g31pranjal

Copy link
Copy Markdown
Member

RecordMetaData.getPlannerType takes record type names and resolves them with getRecordType, which only knows stored record types. So the planner cannot describe a synthetic record type. In particular, IndexExpansionInfo cannot build the base type of an index defined on one.

This adds getPlannerTypeForRecordType(RecordType) and getPlannerTypeForRecordTypes(Collection<RecordType>), which describe the record types they are given rather than looking them up by name. The name-taking overloads now resolve their names and delegate to them, so their behaviour is unchanged. IndexExpansionInfo passes the indexed record types it already holds.

Nothing changes observably yet: indexes on synthetic record types are not offered to the planner. This is groundwork for planning queries against indexes on joined synthetic record types (#4817).

RecordMetaDataPlannerTypeTest covers three cases:

  • the new overload describes a joined record type, which the name-taking overload rejects;
  • for stored types, the new overloads agree with the name-taking ones, including the version pseudo-field when versions are stored;
  • several types are described by the union of their fields, and a single type exactly as on its own.

@g31pranjal g31pranjal added the enhancement New feature or request label Nov 3, 2026
@g31pranjal
g31pranjal marked this pull request as ready for review November 3, 2026 13:50
@g31pranjal
g31pranjal merged commit 05882f7 into main Nov 3, 2026
14 checks passed
@g31pranjal
g31pranjal deleted the apple/g31pranjal/planner-type-for-record-type branch November 3, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants