Re: Pregunta sobre indices

From: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
To: Herman Estaban <hermanestaban(at)gmail(dot)com>, 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-07-26 18:35:47
Message-ID: BLUPR15MB01135BB0352F4EFCBE640F3CE30E0@BLUPR15MB0113.namprd15.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

LO primero es porque no poner los nombres completos y no usar abreviaciones de los campos?

________________________________
From: pgsql-es-ayuda-owner(at)postgresql(dot)org <pgsql-es-ayuda-owner(at)postgresql(dot)org> on behalf of Herman Estaban <hermanestaban(at)gmail(dot)com>
Sent: Thursday, June 23, 2016 5:48 PM
To: Gerardo Herzig; Alberto Cuevas
Cc: pgsql
Subject: Re: [pgsql-es-ayuda] Pregunta sobre indices

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 Edwin Quijada 2016-07-26 18:41:37 Re: hash
Previous Message Guillermo E. Villanueva 2016-07-25 16:06:30 Re: Imagenes desde PowerBuilder 12.5 y PostgreSQL 9.5