Questions about indexes 
Author Message
 Questions about indexes

Hi everyone !

I have some little questions about indexes :

Does PostgreSQL create an index when a table is created?
Does it create index even if there is no PK for this table?
If yes, why?
I know that indexes increase performance for SELECT but it is the
contrary when INSERT because the index must be actualised every time,
isn't it?
How can I see all the index that PostgreSQL have implicitly create?
How can I delete them in keeping integrity in the database?

If someone could answer these questions, I thank him in advance.

Sincerly, Renaud THONNART

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.***.com/



Sun, 26 Oct 2003 16:37:35 GMT
 Questions about indexes

Quote:

> Does PostgreSQL create an index when a table is created?

 Yes, with PK.

Quote:
> Does it create index even if there is no PK for this table?

 No.

Quote:
> I know that indexes increase performance for SELECT but it is the
> contrary when INSERT because the index must be actualised every time,
> isn't it?

 Yes.

Quote:
> How can I see all the index that PostgreSQL have implicitly create?

 You can, from psql, do:

        # \d table_name

 This order shows all info about a table, including existing indexes.

Quote:
> How can I delete them in keeping integrity in the database?

 drop index?...

 Greets.

                                David

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Sun, 26 Oct 2003 17:12:10 GMT
 Questions about indexes
Thank you for your explaination, David !

Renaud THONNART

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Sun, 26 Oct 2003 17:19:37 GMT
 Questions about indexes

Quote:

>> How can I delete them in keeping integrity in the database?

> drop index?...

Dropping the index will not maintain the PK integrity...

http://www.ca.postgresql.org/users-lounge/docs/7.1/reference/sql-crea...
.html
says:
PRIMARY KEY Constraint
Notes:
Postgres automatically creates a unique index to assure data integrity (see
CREATE INDEX statement).

Frank

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Sun, 26 Oct 2003 19:53:39 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Index question (best index structures for a table)

2. Question regarding Indexing

3. Basic question of indexes

4. General SQL Question about Indexing ....HELP!

5. Question on Indexes

6. Questions about indexes?

7. Question about indexes and performance.

8. Question on Index

9. General SQL Question about Indexing ....HELP!

10. 3 questions about indexing image datatype column

11. SQL Namespace Question on Indexes

12. Question on Indexing


 
Powered by phpBB® Forum Software