Search Postgresql Archives

Re: Key Vs Index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 11, 2009 at 12:09 AM, Abdul Rahman <abr_ora@xxxxxxxxx> 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux