Skip to content

[FEATURE]: ajout d'un index sur updatedAt sur la table assessments#16568

Open
sandalfon wants to merge 1 commit into
devfrom
ansummer-body-updated-assessment-index
Open

[FEATURE]: ajout d'un index sur updatedAt sur la table assessments#16568
sandalfon wants to merge 1 commit into
devfrom
ansummer-body-updated-assessment-index

Conversation

@sandalfon

Copy link
Copy Markdown
Contributor

🪧 Problème

Dans le cadre de l'historisation des answers on va requeter les assessemnts sur la date de mise à jour et c'est long

🌈 Proposition

ajout d'un index sur la table

✊ Remarques

🎉 Pour tester

@sandalfon sandalfon requested a review from a team as a code owner June 18, 2026 10:07
@pix-bot-github

Copy link
Copy Markdown


const up = async function (knex) {
await knex.schema.table(TABLE_NAME, function (table) {
table.index(COLUMN_NAME);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

la table assessments n'est pas une petite table. Pour éviter les problèmes d'availability sur la prod je recommande plutôt :

  • De demander aux captains la création de l'index en mode CONCURRENCY sur la prod (entre midi et deux par ex)
  • Une fois cela fait, éditer cette PR pour faire un CREATE INDEX IF NOT EXISTS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour info, on ne peut pas créer un index en CONCURRENTLY dans une migration Knex.
Les migrations Knex doivent obligatoirement être jouées dans une transaction, or la clause CONCURRENTLY impose l'exécution hors transaction

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oui on comptait bien passer par les capitaines pour la création

Signed-off-by: Gilles Vieira <vieira.gille@gmail.com>
@sandalfon sandalfon force-pushed the ansummer-body-updated-assessment-index branch from 21341a8 to e37396b Compare June 18, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants