Development #51681
ajouter un index sur la table des dates
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
04 mars 2021
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
Dans l'explain d'une requête lente,
-> Nested Loop (cost=0.00..8879.84 rows=1 width=10) Join Filter: (formdata.receipt_time = receipt_time.date) -> Seq Scan on dates receipt_time (cost=0.00..95.50 rows=1 width=4) Filter: ((date >= '2021-01-01'::date) AND (date < '2022-01-01'::date))
Après la création d'un index (create index dates_index on public.dates (date);
),
-> Nested Loop (cost=0.29..23.74 rows=1 width=73) Join Filter: (formdef.category_id = category.id) -> Index Scan using formdef_pkey on formdef (cost=0.14..14.36 rows=81 width=77) -> Materialize (cost=0.15..8.17 rows=1 width=4) -> Index Scan using category_ref_key on category (cost=0.15..8.17 rows=1 width=4) Index Cond: ((ref)::text = 'signalements'::text)
Et une requête qui passe de 21 à 0,6 secondes.
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 3 ans
- Projet changé de BiJoe à OLAP / Business Intelligence pour Publik
Mis à jour par Frédéric Péters il y a environ 3 ans
- Fichier 0001-add-index-on-dates-51681.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Frédéric Péters il y a environ 3 ans
(correction typo)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Fichier
0001-add-index-on-dates-51681.patchsupprimé
Mis à jour par Valentin Deniaud il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 1640abbfdc3f14aa93ab7a86950b48392c4cbf50 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Thu Mar 4 21:01:29 2021 +0100 add index on dates (#51681)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
add index on dates (#51681)