Re: Key Vs Index
| От | Scott Marlowe |
|---|---|
| Тема | Re: Key Vs Index |
| Дата | |
| Msg-id | dcc563d10902102332oaf329e6i50b63e693e2d5b0d@mail.gmail.com обсуждение исходный текст |
| Ответ на | Key Vs Index (Abdul Rahman <abr_ora@yahoo.com>) |
| Ответы |
Re: Key Vs Index
|
| Список | pgsql-general |
On Wed, Feb 11, 2009 at 12:09 AM, Abdul Rahman <abr_ora@yahoo.com> wrote:
> In Oracle, the index is automatically created during the creation of Primary
> Key. But in PostgreSQL either index is implicitly created of the user hast
> create it explicitly. I don't find any index against Primary Key and have to
> create index on this key.
Let's look:
smarlowe=# create table test (id int primary key, info text);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"test_pkey" for table "test"
CREATE TABLE
smarlowe=# \d test
Table "public.test"
Column | Type | Modifiers
--------+---------+-----------
id | integer | not null
info | text |
Indexes:
"test_pkey" PRIMARY KEY, btree (id)
See where it says btree(id) under Indexes:? That's telling you it's
got an index.
Note that the index on the FK side isn't auto created.
В списке pgsql-general по дате отправления: