Skip to content

Page + count in one statement, cached insert plans, fast UTC hydration - #2

Merged
DavidWilliamBalbino merged 2 commits into
mainfrom
perf/ten-x
Nov 19, 2026
Merged

DavidWilliamBalbino merged 2 commits into
mainfrom
perf/ten-x

Conversation

@DavidWilliamBalbino

Copy link
Copy Markdown
Contributor

Select::fetchPage (COUNT real como subquery), fix de parâmetros em subquery como coluna, plano de insert com datetime em cache, hidratação UTC via pam_native_utc_datetime quando disponível. Testes de fetchPage e subquery-coluna.

…e datetime hydration

- Select::fetchPage(limit, offset): the page and the COUNT of the whole query in one
  statement (the count is a scalar subquery column of the page query), through the
  cached shape plan; past the last row or for customized selects it falls back to
  count() plus fetchAll(). Shape plans map a value to every parameter it lands in.
- SelectQuery::countQuery() is the query count() runs.
- CompilerCache hashed a SelectQuery column through __toString(): its values were
  interpolated into the cache key and its parameters were never bound.
- StatementPlans accept DateTimeInterface values (the driver formats them when binding),
  so inserts and updates with timestamps reuse the cached statement.
- Driver::getTimezone() keeps one DateTimeZone per configured name.
- DirectInsert keeps role descriptions per ORM instead of per unit of work.
- Compiled row makers construct datetime fields inline in the driver timezone.
…he runtime has it

On the PAM runtime a UTC datetime column is a filled-in clone of a prototype instead
of a parse: the same DateTimeImmutable the constructor returns, about 4x cheaper.
Values the function does not take (other shapes, zones or non-strings) still go to
the constructor.
@DavidWilliamBalbino
DavidWilliamBalbino merged commit 8e02157 into main Nov 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant