Re: [GENERAL] Shorthand for foreign key indices

2005-05-10 Thread Brendan Jurd
On 5/9/05, Jim C. Nasby <[EMAIL PROTECTED]> wrote: > On Mon, May 09, 2005 at 02:05:14AM +1000, Brendan Jurd wrote: > > CREATE TABLE foo ( > > foo int NOT NULL REFERENCES bar INDEX > > ); > > > > ... would be marvellous > > I agree that it would be handy. Another possibility is throwing a NOTICE >

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread Brendan Jurd
> I'm guessing now that we're just talking about a regular index on a > column that happens to have a foreign key reference to another column. > Is that the case? > That's true, but just as the query planner can use an index for WHERE conditions, it can use an index for a join condition. So if y

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread Scott Marlowe
On Mon, 2005-05-09 at 12:40, John D. Burger wrote: > >> By the way, I presume foreign key indices are used to check for > >> referential integrity on insert. Can the query planner also use then > >> somehow? > > > > It can use them the same way it can use any other index. > > Hmm, I guess I thoug

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread John D. Burger
By the way, I presume foreign key indices are used to check for referential integrity on insert. Can the query planner also use then somehow? It can use them the same way it can use any other index. Hmm, I guess I thought that "foreign key indices" were some special kind of index. For instance,

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread Jim C. Nasby
On Mon, May 09, 2005 at 09:04:49AM -0400, John D. Burger wrote: > >I know that it was decided a fair few releases ago to stop creating an > >implicit index for each foreign key, > > By the way, I presume foreign key indices are used to check for > referential integrity on insert. Can the query p

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread John D. Burger
I know that it was decided a fair few releases ago to stop creating an implicit index for each foreign key, By the way, I presume foreign key indices are used to check for referential integrity on insert. Can the query planner also use then somehow? Thanks. - John D. Burger MITRE ---

Re: [GENERAL] Shorthand for foreign key indices

2005-05-08 Thread Jim C. Nasby
On Mon, May 09, 2005 at 02:05:14AM +1000, Brendan Jurd wrote: > CREATE TABLE foo ( > foo int NOT NULL REFERENCES bar INDEX > ); > > ... would be marvellous I agree that it would be handy. Another possibility is throwing a NOTICE or even WARNING if you create a foreign key that isn't covered by a