Re: its really SLOW!!!!!

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re: its really SLOW!!!!!
Date: 2002-12-03 17:38:32
Message-ID: 1038937112.7312.62.camel@haggis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, 2002-12-03 at 09:53, Adler, Stephen wrote:
> Paul and Michael,
[snip]
>
> When I went to fill this table, under psql, psql immediately
> gave me errors saying that magent(masterindex) was being
> filled with identical values. So, is there a way of defining
> an index as part of the create table command, or is this
> a mysql extention? After reading the chapter on Indexs in

Is there a pressing need to have it in only 1 statement?

> the users guide, there is no mention of creating an index
> as part of the create table, but rather an index is
> a separate entity used to aid the select command. Am I
> getting keys and indexes mixed up? (I assume they are
> the same thing....)

Pedanticly, a key and an index are radically different:
- A key describes a set of records.
- with Primary Key, that set must only contain 1 record.
- Foreign Keys describe sets of 1 or more records that
also have a Primary Key of the same value in a seperate
table.
- An index is a method speeding up access to data. Typical
types of indexes are:
- Hashes
- Trees

As you can see, a UNIQUE index (note that I am not describing
how the index works) is perfect for *implementing* primary keys.
Postgres takes a short cut, and implicitly creates a unique
index when you define a primary key.

"Duplicates allows" indexes are used by Postgres to implement
foreign keys, but, as you see from magent(masterindex), they
are usually used "just" to speed access.

Ron
--
+------------------------------------------------------------+
| Ron Johnson, Jr. mailto:ron(dot)l(dot)johnson(at)cox(dot)net |
| Jefferson, LA USA http://members.cox.net/ron.l.johnson |
| |
| "they love our milk and honey, but preach about another |
| way of living" |
| Merle Haggard, "The Fighting Side Of Me" |
+------------------------------------------------------------+

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Warren Massengill 2002-12-03 19:48:52 Re: Copy entire file as one field
Previous Message Adler, Stephen 2002-12-03 15:53:38 Re: its really SLOW!!!!!