-
-
Notifications
You must be signed in to change notification settings - Fork 479
test phpstan-dba feature branch #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
composer.lockClick to show 192 changes in this composer.lock filePackage changes
Dev Package changes
Settings · Docs · Powered by Private Packagist |
|
The composer.lock diff comment has been updated to reflect new changes in this PR. |
|
@chr-hertel since I don't want to annoy Jordi again with my question, I send this question to you - would be great if you could spent a few minutes to answer them. with this PR I am testing a new phpstan-dba feature, which analyzes sql queries that don't use an index. could you have a look at these and tell me whether you would consider those a "false-positive"? the current implemenation can be seen in https://github.com/staabm/phpstan-dba/pull/377/files#diff-325c727a8f7834a6b7b42f1b3fbfcaa5c41073e796df7eda0fa5f25a48757eb3R55-R83 |
|
@staabm looking at the reported issues, they are indeed detecting cases where queries don't use indexes (but then, I'm wondering whether it should always be reported as an error, as having indexes for everything might have drawbacks as it slows down writes, which might not be worth it if a query is used rarely in a CLI command for instance, but that's a separate topic). |
|
The composer.lock diff comment has been updated to reflect new changes in this PR. |
|
@stof thx for the feedback. ignoring DERIVED-tables seems like a good measure to prevent false-positives -> I will implement just that. I got another feedback in staabm/phpstan-dba#377 (comment) which made me add a threshold, so we don't report missing indexes/table-scan when tables are small (mysql sometime decides reading the table as is is faster then using an index, when small enough). |
|
The composer.lock diff comment has been updated to reflect new changes in this PR. |
|
just update phpstandba and now we no longer get errors. it seems the few which were reported previous are related to small tables |
|
Well, is the CI running with data in tables or with an empty DB ? |
|
I guess its an empty schema currently see packagist/.github/workflows/phpstan.yml Lines 41 to 52 in 6a40c01
|
|
@staabm yeah table size metrics seem to be kinda useless as you're unlikely to have prod data in when running PHPStan. Otherwise great feature even with some amount of false positives IMO.. maybe should be opt-in or at least have an option to opt-out if it is too noisy. |
|
thx for the feedback.
its an opt-in feature and the min-table size arg can be configured with the RuntimeConfiguration just added an explicit hint, on how to achieve that scenario |
|
The composer.lock diff comment has been updated to reflect new changes in this PR. |
just testing a bleeding edge phpstan dba feature