-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
--- | ||
title: Refresh | ||
title: Refresh Mechanism | ||
--- | ||
|
||
## `SummarySignal` | ||
## `DirtyFlag` | ||
|
||
A `SummarySignal` is an entity indicating a dirty partition, which is a | ||
partition in a summary table that needs to be refreshed. `SummarySignal` should | ||
be persisted and flushed at the same time as the rest of the entities, during | ||
the `onFlush` event. So if the flush fails, the signal will not be saved. | ||
A `DirtyFlag` is an entity indicating a dirty partition, which is a partition in | ||
a summary table that needs to be refreshed. `DirtyFlag` should be persisted and | ||
flushed at the same time as the rest of the entities, during the `onFlush` | ||
event. So if the flush fails, the flag will not be saved. | ||
|
||
A `SummarySignal` can have null partition information. In this case, it means | ||
there are new persisted entities that need to be summarized. New entities | ||
need to be handled differently because they are not guaranteed to have an | ||
ID before flush. | ||
A `DirtyFlag` can have null partition information. In this case, it means there | ||
are new persisted entities that need to be summarized. New entities need to be | ||
handled differently because they are not guaranteed to have an ID before flush. | ||
|
||
## `SourceEntityListener` | ||
|
||
Listens on Doctrine's `onFlush` event. For every pending entities, it checks the | ||
change set and determines if the change affects any summary tables. Then it | ||
instantiates the corresponding `SummarySignal` objects and persists them. | ||
change set and determines if the change affects any summary tables. If a | ||
property is changed, and that would affect one or more summary tables, it | ||
creates the corresponding `DirtyFlag` objects for each of the partition that | ||
needs to be refreshed. | ||
|
||
:::warning | ||
|
||
This automatic detection works only for simple cases: it only detects the change | ||
of the properties in the entity itself. If the change is in a related entity, it | ||
will not | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: Current To-do List | ||
--- | ||
|
||
## Bugs | ||
|
||
* Max and min values do not consider `HasQueryBuilderModifier` | ||
* Canonicalize grouping column ordering (use alphabetical order?), avoid relying | ||
on undefined reflection ordering. | ||
|
||
## Missing Features | ||
|
||
* Doctrine ORM 3 support | ||
* Metadata caching | ||
* Disable refresh event dispatching in manual refresh | ||
* Support for MS SQL Server | ||
* Configurable event timing (`RefreshClassPropertiesResolver`) | ||
* Allow customized generation of dirty flag (see `DirtyFlagGenerator`) | ||
* It should be possible for `DirtyFlagGenerator` to generate dirty partition | ||
signals for non-`IDENTITY` entities, bypassing 'new entity' phase. | ||
* Hyperloglog | ||
* Binning value resolver | ||
* Measure using getter (example: getAverage() that gets its value from `$this->sum / $this->count`) | ||
|
||
## Limitations | ||
|
||
* Postgres `GROUP BY` maximum grouping set limit of 4096, can be circumvented by | ||
using multiple queries. | ||
|
||
## Reorganization | ||
|
||
* Spin off pivot table to its own package. | ||
* Exception refactoring |