Projet

Général

Profil

Development #51681

ajouter un index sur la table des dates

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

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

0001-add-index-on-dates-51681.patch (796 octets) 0001-add-index-on-dates-51681.patch Frédéric Péters, 04 mars 2021 21:07

Révisions associées

Révision 1640abbf (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

add index on dates (#51681)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Projet changé de BiJoe à OLAP / Business Intelligence pour Publik
#2

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
#5

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Fichier 0001-add-index-on-dates-51681.patch supprimé
#6

Mis à jour par Valentin Deniaud il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée
#7

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)
#8

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

Formats disponibles : Atom PDF