[PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Burak Seydioglu
I do a load of sql joins using primary and foreign keys. What i would like to know if PostgreSQL creates indexes on these columns automatically (in addition to using them to maintain referential integrity) or do I have to create an index manually on these columns as indicated below? CREATE TABLE

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Tom Lane
Burak Seydioglu [EMAIL PROTECTED] writes: I do a load of sql joins using primary and foreign keys. What i would like to know if PostgreSQL creates indexes on these columns automatically (in addition to using them to maintain referential integrity) or do I have to create an index manually on

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Burak Seydioglu
How about the performance effect on SELECT statements joining multiple tables (LEFT JOINS)? I have been reading all day and here is an excerpt from one article that is located at http://pgsql.designmagick.com/tutorial.php?id=19pid=28 [quote] The best reason to use an index is for joining

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread K C Lau
At 07:21 06/01/12, Michael Fuhr wrote: On Wed, Jan 11, 2006 at 02:38:42PM -0800, Burak Seydioglu wrote: I do a load of sql joins using primary and foreign keys. What i would like to know if PostgreSQL creates indexes on these columns automatically (in addition to using them to maintain

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Michael Glaesemann
On Jan 12, 2006, at 9:36 , K C Lau wrote: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index cities_pkey for table cities Is there a way to suppress this notice when I create tables in a script? Set[1] your log_min_messages to WARNING or higher[2].

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Michael Fuhr
On Thu, Jan 12, 2006 at 10:26:58AM +0900, Michael Glaesemann wrote: On Jan 12, 2006, at 9:36 , K C Lau wrote: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index cities_pkey for table cities Is there a way to suppress this notice when I create tables in a script? Set[1]

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread K C Lau
At 09:26 06/01/12, you wrote: On Jan 12, 2006, at 9:36 , K C Lau wrote: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index cities_pkey for table cities Is there a way to suppress this notice when I create tables in a script? Set[1] your log_min_messages to WARNING or

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Tom Lane
K C Lau [EMAIL PROTECTED] writes: Thanks. The side effect is that it would suppress other notices which might be useful. There's been some discussion of subdividing the present notice category into two subclasses, roughly defined as only novices wouldn't know this and maybe this is