Re: Wich hardware suits best for large full-text indexed databases - Mailing list pgsql-general

From Dann Corbit
Subject Re: Wich hardware suits best for large full-text indexed databases
Date
Msg-id D90A5A6C612A39408103E6ECDD77B829408D4E@voyager.corporate.connx.com
Whole thread Raw
In response to Wich hardware suits best for large full-text indexed databases  (Diogo Biazus <diogo@ikono.com.br>)
List pgsql-general
I see that only table documentos has a unique index.  Is it really so
that none of the other tables has a key to uniquely identify a record?
Perhaps the others have a unique attribute but it was never declared
when forming the index?

I do not remember which version of PostgreSQL you are using, but there
is now a CLUSTER command.  Now, I am speaking with my experience in
other database systems, and so perhaps the PostgreSQL group may find it
necessary to correct me.  I have only recently began working with
PostgreSQL versions beyond 7.1.3 which had no cluster command (or at
least I was not aware of one).  In other database systems, a clustered
index is incredibly valuable.  In fact, a unique, clustered index is
always a silver bullet to marvelous performance.  Perhaps some of the
experts can give measurements as to the effectiveness of clustering in
PostgreSQL.  Here is the link for the cluster documentation:
http://www.postgresql.org/docs/current/static/sql-cluster.html

From the description, clustering is expensive and your tables are large.
So it should be an infrequent operation.


> -----Original Message-----
> From: Diogo Biazus [mailto:diogo@ikono.com.br]
> Sent: Wednesday, March 31, 2004 10:30 AM
> To: Dann Corbit
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Wich hardware suits best for large
> full-text indexed databases
>
>
> Dann Corbit wrote:
>
> >Can we see the underlying tables also?
> >
> >
> CREATE TABLE public.documentos
> (
>   coddocumento serial NOT NULL,
>   codfonte int4 NOT NULL,
>   codsecao int4,
>   codusuario int4,
>   codposicaopagina int4,
>   codinterno varchar(255),
>   nomedocumento text NOT NULL,
>   subtitulo text,
>   resumohumano text,
>   resumoautomatico text,
>   conteudo text,
>   datapublicacao date,
>   localorigem varchar(255),
>   horapublicacao time,
>   pagina varchar(5),
>   anoedicao varchar(5),
>   numeroedicao_old varchar(10),
>   nomeautor varchar(255),
>   datainsercao timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6)
> with time zone,
>   url text,
>   codtipoinsercao varchar(1) NOT NULL,
>   codbusca int4,
>   codtipodocumento int4 NOT NULL,
>   codformato int4 NOT NULL,
>   analisado bool NOT NULL DEFAULT false,
>   numeroedicao varchar(120),
>   conteudo_stem_ix public.tsvector,
>   conteudo_ix public.tsvector,
>   numeroimagens int4 DEFAULT 0,
>   numeroacessos int4 DEFAULT 0,
>   codtarefa int8,
>   md5arquivo varchar(32),
>   CONSTRAINT documentos_pkey PRIMARY KEY (coddocumento),
>   CONSTRAINT arquivos_documentos_fk FOREIGN KEY (md5arquivo)
> REFERENCES
> public.arquivos (md5arquivo) ON UPDATE CASCADE ON DELETE CASCADE,
>   CONSTRAINT buscas_documentos FOREIGN KEY (codbusca) REFERENCES
> public.buscas (codbusca) ON UPDATE CASCADE ON DELETE CASCADE,
>   CONSTRAINT fontes_documentos FOREIGN KEY (codfonte) REFERENCES
> public.fontes (codfonte) ON UPDATE NO ACTION ON DELETE NO ACTION,
>   CONSTRAINT secoes_documentos FOREIGN KEY (codsecao) REFERENCES
> public.secoes (codsecao) ON UPDATE NO ACTION ON DELETE NO ACTION,
>   CONSTRAINT tiposdocumento_documentos FOREIGN KEY (codtipodocumento)
> REFERENCES public.tiposdocumento (codtipodocumento) ON UPDATE
> CASCADE ON
> DELETE NO ACTION,
>   CONSTRAINT tiposinsercao_documentos FOREIGN KEY (codtipoinsercao)
> REFERENCES public.tiposinsercao (codtipoinsercao) ON UPDATE
> NO ACTION ON
> DELETE NO ACTION,
>   CONSTRAINT usuarios_documentos FOREIGN KEY (codusuario) REFERENCES
> public.usuarios (codusuario) ON UPDATE NO ACTION ON DELETE NO ACTION
> ) WITH OIDS;
>
> CREATE INDEX documentos_ajustaautor_ix
>   ON public.documentos
>   USING btree
>   (public.ajustaautor(nomeautor) text_ops);
>
> CREATE INDEX documentos_ajustadata_ix
>   ON public.documentos
>   USING btree
>   (public.ajustadata(datapublicacao) date_ops);
>
> CREATE INDEX documentos_ajustahora_ix
>   ON public.documentos
>   USING btree
>   (public.ajustahora(horapublicacao) time_ops);
>
> CREATE INDEX documentos_codtipodocumento_ix
>   ON public.documentos
>   USING btree
>   (codtipodocumento);
>
> CREATE UNIQUE INDEX documentos_codfonte_codinterno_ix
>   ON public.documentos
>   USING btree
>   (codinterno, codfonte);
>
> CREATE INDEX documentos_codfonte_ix
>   ON public.documentos
>   USING btree
>   (codfonte);
>
> CREATE INDEX documentos_codformato_ix
>   ON public.documentos
>   USING btree
>   (codformato);
>
> CREATE INDEX documentos_conteudo_stem_ix_ix
>   ON public.documentos
>   USING gist
>   (conteudo_stem_ix);
>
> CREATE INDEX documentos_conteudo_ix_ix
>   ON public.documentos
>   USING gist
>   (conteudo_ix);
>
>
>
> CREATE TABLE public.fontes
> (
>   codfonte serial NOT NULL,
>   codtipofonte int4 NOT NULL,
>   nomefonte varchar(50) NOT NULL,
>   ativo bool NOT NULL DEFAULT true,
>   periodicidade varchar(1),
>   codagente int4,
>   CONSTRAINT fontes_pkey PRIMARY KEY (codfonte),
>   CONSTRAINT tiposfonte_fontes FOREIGN KEY (codtipofonte) REFERENCES
> public.tiposfonte (codtipofonte) ON UPDATE NO ACTION ON
> DELETE NO ACTION
> ) WITH OIDS;
>
> CREATE INDEX fontes_codtipofonte_ix
>   ON public.fontes
>   USING btree
>   (codtipofonte);
>
> CREATE INDEX fontes_nomefonte_ix
>   ON public.fontes
>   USING btree
>   (nomefonte);
>
>
>
> CREATE TABLE public.fontes_gruposusuario
> (
>   codfonte int4 NOT NULL,
>   codgrupousuario int4 NOT NULL,
>   CONSTRAINT fontes_gruposusuario_pkey PRIMARY KEY (codfonte,
> codgrupousuario),
>   CONSTRAINT fontes_gruposusuario_codfonte_fk FOREIGN KEY (codfonte)
> REFERENCES public.fontes (codfonte) ON UPDATE CASCADE ON
> DELETE CASCADE,
>   CONSTRAINT fontes_gruposusuario_codgrupousuario_fk FOREIGN KEY
> (codgrupousuario) REFERENCES public.gruposusuario
> (codgrupousuario) ON
> UPDATE CASCADE ON DELETE CASCADE
> ) WITH OIDS;
>
> CREATE INDEX fontes_gruposusuario_codfonte_ix
>   ON public.fontes_gruposusuario
>   USING btree
>   (codfonte);
>
> CREATE INDEX fontes_gruposusuario_codgrupousuario_ix
>   ON public.fontes_gruposusuario
>   USING btree
>   (codgrupousuario);
>
> CREATE TABLE public.tiposdocumento_gruposusuario
> (
>   codtipodocumento int4 NOT NULL,
>   codgrupousuario int4 NOT NULL,
>   CONSTRAINT tiposdocumento_gruposusuario_pkey PRIMARY KEY
> (codtipodocumento, codgrupousuario),
>   CONSTRAINT tiposdocumento_gruposusuario_codtipodocumento_fk FOREIGN
> KEY (codtipodocumento) REFERENCES public.tiposdocumento
> (codtipodocumento) ON UPDATE CASCADE ON DELETE CASCADE,
>   CONSTRAINT tiposdocumentos_gruposusuario_codgrupousuario_fk FOREIGN
> KEY (codgrupousuario) REFERENCES public.gruposusuario
> (codgrupousuario)
> ON UPDATE CASCADE ON DELETE CASCADE
> ) WITHOUT OIDS;
>
>
> CREATE INDEX tiposdocumento_gruposusuario_codgrupousuario_ix
>   ON public.tiposdocumento_gruposusuario
>   USING btree
>   (codgrupousuario);
>
> CREATE INDEX tiposdocumento_gruposusuario_codtipodocumento_ix
>   ON public.tiposdocumento_gruposusuario
>   USING btree
>   (codtipodocumento);
>
>
>
> --
> Diogo Biazus
> diogo@ikono.com.br
> http://www.ikono.com.br
>
>

pgsql-general by date:

Previous
From: Diogo Biazus
Date:
Subject: Re: Wich hardware suits best for large full-text indexed
Next
From: "Thomas LeBlanc"
Date:
Subject: Does an index get create for a Primary Key?