Skip to content

more fine grained dependency tracking #813

Open

Description

@staabm

with the initial implementation of DbSchemaResultCacheMetaExtension phpstan-dba learned to invalidate the whole phpstan result cache when the external schema changes.

this means all code, no matter whether it depends on the database schema has to be re-analyzed.


with #810 phpstan-dba learned to re-analyse only such code which depends on the database schema. that way not all code needed to be re-analyzed.


for the future we could improve this even more:

Step 1: track which database tables are referenced from which code. build a schema-hash per database table instead of per the whole schema. re-analyze only code relevant to the tables which was changed

Step 2 (even more fine grained) : track which table-columns are referenced from which code. when columns change in the db-schema re-analyze only the code which depends on the changed column(s). this needs to be aware of implicit references like SELECT * etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions