unique constraints on foreign keys

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема unique constraints on foreign keys
Дата
Msg-id 20040920204151.87057.qmail@web50008.mail.yahoo.com
обсуждение исходный текст
Ответы Re: unique constraints on foreign keys  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-admin
Hi all,

I have a reference table that holds all the status
used in a system (it's a very little table just 10 or
15 rows).

create table status (
 cod_status     char(2)     not null primary key,
 nam_status     text        not null
);

create table some_other_table (
 ... definition of the table ...
 status         char(2) not null references status
);

ok. This is the idea if a want to do a reference to
the status table i need to create a primary key or a
unique index on the status table.

Obviously the planner will choose always a seq scan in
such a table (it's obvious to you, it's obvious to me,
but not to the planner), but the planner will
calculate the cost of use the index and will choose
the seq.
So, there is a way to teach the planner always do a
seq on that table and do not ask for use the index?
There is a way to not enforce the creation of a
primary or unique index on a referenced table?

(I mean, a way that not involves the use of a "set"
instruction because the odbc not allow such
instructions)

Thanx in advance,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

В списке pgsql-admin по дате отправления:

Предыдущее
От: rjyoung@scs.carleton.ca
Дата:
Сообщение: Postgres setup question
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: unique constraints on foreign keys