Hello,
J'ai actuellement une table qui fait 32ko et qui possede 200ko d'indexe, j'aimerais savoir si c'est un probleme ?
Cette table est surtout utilisé en lecture (ce sont des articles), le vitesse des updates et des insert m'importe peut, je cherche juste a avoir des SELECTs rapides
Voila la structure de la table (en partie généré par l'ORM de Django)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
-- Table: blog_article
 
-- DROP TABLE blog_article;
 
CREATE TABLE blog_article
(
  id serial NOT NULL,
  title character varying(255) NOT NULL,
  header_image character varying(255) NOT NULL,
  slug character varying(50) NOT NULL,
  format integer NOT NULL,
  category_id integer NOT NULL,
  author_id integer NOT NULL,
  content text NOT NULL,
  comments_enabled boolean NOT NULL,
  publication_mode integer NOT NULL,
  date_of_creation timestamp with time zone NOT NULL,
  date_of_modification timestamp with time zone NOT NULL,
  tsv tsvector,
  CONSTRAINT blog_article_pkey PRIMARY KEY (id),
  CONSTRAINT blog_article_author_id_fkey FOREIGN KEY (author_id)
      REFERENCES auth_user (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT category_id_refs_id_25820696 FOREIGN KEY (category_id)
      REFERENCES blog_category (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT blog_article_slug_key UNIQUE (slug),
  CONSTRAINT blog_article_title_key UNIQUE (title)
)
WITH (OIDS=FALSE);
ALTER TABLE blog_article OWNER TO kedare;
 
-- Index: blog_article_author_id
 
-- DROP INDEX blog_article_author_id;
 
CREATE INDEX blog_article_author_id
  ON blog_article
  USING btree
  (author_id);
 
-- Index: blog_article_category_id
 
-- DROP INDEX blog_article_category_id;
 
CREATE INDEX blog_article_category_id
  ON blog_article
  USING btree
  (category_id);
 
-- Index: blog_article_tsv
 
-- DROP INDEX blog_article_tsv;
 
CREATE INDEX blog_article_tsv
  ON blog_article
  USING gin
  (tsv);
 
 
-- Trigger: tsvector_update on blog_article
 
-- DROP TRIGGER tsvector_update ON blog_article;
 
CREATE TRIGGER tsvector_update
  BEFORE INSERT OR UPDATE
  ON blog_article
  FOR EACH ROW
  EXECUTE PROCEDURE tsvector_update_trigger('tsv', 'pg_catalog.french', 'title', 'content');
Qu'en pensez vous ?
Merci