Re: Pregunta sobre indices

From: Herman Estaban <hermanestaban(at)gmail(dot)com>
To: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>, Alberto Cuevas <betocuevas(dot)net(at)gmail(dot)com>
Cc: pgsql <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Pregunta sobre indices
Date: 2016-06-23 17:48:12
Message-ID: CAC-DekUejciW0_kf3AS4ttEjRH68y4TOdsUZ8PsRwg1hawaG-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola, aprovechando el hilo.Les comento mi caso, existe una tabla en una
base de datos SQL Server de nombre SFT_MAEPROD en la que se almacena la
informacion de los productos que vende la empresa (ropa).

Esta tabla tenie mas de 100 campos y no esta normalizada, en verdad todas
las tablas de esta base de datos en SQL Server no estan normalizadas.

Se esta creando una nueva base de datos en PostgreSQL para dejar de usar ya
el SQL Server.

Una vez que se termine de hacer la migración de información de SQL Server a
PostgreSQL, tendre que armar consultas y reportes (JOINS) con distintos
tipos de filtros, necesitare indices para tener un tiempo de respuesta
favorable

He normalizado esta tabla SFT_MAEPROD en PostgreSQL, y he pensado crear
indices, mi idea es que quede asi:

CREATE TABLE public.sft_maesede (
id_sft_sede serial NOT NULL PRIMARY KEY, -->id sede
nom_sft_sede varchar(50), --nombre sede

CREATE TABLE public.sft_maealma (
id_sft_alma serial NOT NULL PRIMARY KEY, --> id almacen
id_sft_sede integer NOT NULL, --id sede ----> (CREAR INDICE)
nom_sft_alma varchar(50), --nombre almacen

CREATE TABLE public.sft_maeprod (
id_sft_prod bigserial NOT NULL PRIMARY KEY, -->id producto
id_sft_fami integer NOT NULL, --id familia ----> (CREAR
INDICE)
id_sft_clas integer NOT NULL, --id clase ----> (CREAR
INDICE)
id_sft_mode integer NOT NULL, --id modelo ----> (CREAR INDICE)
id_sft_line integer NOT NULL, --id linea ----> (CREAR
INDICE)
id_sft_mate integer NOT NULL, --id material ----> (CREAR INDICE)
id_sft_colo integer NOT NULL, --id color ----> (CREAR
INDICE)
id_sft_tall integer NOT NULL, --id talla ----> (CREAR
INDICE)
id_sft_temp integer NOT NULL, --id temporada ----> (CREAR INDICE)
id_sft_gene integer NOT NULL, --id genero ----> (CREAR INDICE)
id_sft_pres integer NOT NULL, --id presentacion ----> (CREAR
INDICE)
nom_stf_prod varchar(100), --nombre producto ----> (CREAR
INDICE)

CREATE TABLE public.sft_prodxalm (
id_sft_codi bigserial NOT NULL PRIMARY KEY, --> id
id_sft_sede integer NOT NULL, --id sede ----> (CREAR
INDICE)
id_sft_alma integer NOT NULL, --id almacen ----> (CREAR INDICE)
id_sft_prod bigint NOT NULL, --id producto ----> (CREAR
INDICE)

Estoy en lo correcto?,

Espero sus comentarios.

Saludos.

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2016-06-23 18:00:07 Re: Pregunta sobre indices
Previous Message Eduardo Morras 2016-06-23 16:41:39 Re: problemas pg_dump