mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
docs(ai): document hidden counts in application queries
This commit is contained in:
@@ -155,5 +155,8 @@
|
||||
## Validate input safely
|
||||
- In PCRE, `$` also matches before a final `\n`. In validation regexes, use `\z` or reject control characters first, or a trailing newline passes.
|
||||
|
||||
## Application queries carry hidden counts
|
||||
- `Application` has a global scope `withRelations` that adds two `withCount` subqueries and `applications.*`, also to `pluck('id')` and eager loads. For ID lookups and lean eager loads, call `withoutGlobalScope('withRelations')`.
|
||||
|
||||
## Measure database reads end to end
|
||||
- On PostgreSQL 15, `EXPLAIN (ANALYZE, BUFFERS)` does not detoast or send the selected columns, so a wide `jsonb`/`json`/`text` column does not show in it. Time the full fetch (`psql \timing` with `-o /dev/null`, or PDO `fetchAll`) as well before you blame or rule out an index.
|
||||
|
||||
Reference in New Issue
Block a user