2013/10/29 Pedro PG <[email protected]>:
> Buen día lista, tengo una consulta, tengo dos tablas (el típico maestro -
> detalle).
>
> Tabla: lugar (id serial, nombre varchar) -> id tiene un indice HASH.
> Tabla: ruta (id serial, idlugar integer) -> id tiene un indice HASH, ¿es
> necesario crear un indice en idlugar? y en el caso la respuesta sea si como
> es que deberia hacerlo.
>

No tengo la menor idea de si deberías crear ese índice. Para saber eso
necesitaríamos saber: 1) cuantos registros tendrá la tabla 2) que tan
frecuentemente se consultará por el campo idlugar y 3) que tan
selectivas serán dichas consultas.

Lo que si se, es que no deberías estar usando índices HASH

http://www.postgresql.org/docs/current/static/indexes-types.html
"""
Caution

Hash index operations are not presently WAL-logged, so hash indexes
might need to be rebuilt withREINDEX after a database crash if there
were unwritten changes. Also, changes to hash indexes are not
replicated over streaming or file-based replication after the initial
base backup, so they give wrong answers to queries that subsequently
use them. For these reasons, hash index use is presently discouraged.
"""

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566         Cell: +593 987171157

-
Enviado a la lista de correo pgsql-es-ayuda ([email protected])
Para cambiar tu suscripción:
http://www.postgresql.org/mailpref/pgsql-es-ayuda

Responder a