Problem/Motivation

At https://www.drupal.org/docs/8/api/database-api/dynamic-queries/introduct...

> In 90% of the use cases you will have a static query. When performance is critical, query() should be used instead of select(). Dynamic queries should be used when the query parts vary, when they should be alterable, or when an extendable query class is used.

but the page next door, https://www.drupal.org/docs/develop/drupal-apis/database-api/static-quer...

> As general advice, the recommendation is that only very simple SELECT queries should use the static query() method. Wherever possible, you should use a dynamic query which are useful for building complex queries that can still allow dynamic query generation and alterability while generally being easier to ensure the generated query is safe.

These seem to be contradicting each other!

Proposed resolution

Remaining tasks

Comments

joachim created an issue.

avpaderno’s picture

IMO, both the pages are over-simplifying.
I am not even sure that in 90% of the use cases a static query should be used.