Indexes again

Started by Silas Justinianoabout 20 years ago3 messagesgeneral
Jump to latest
#1Silas Justiniano
silasju@gmail.com

Sorry, I'll remake (rewrite? redo? ... bad English :/ ) my question:

I have Books, Authors and Intermediate table. At intermediate I'm
currently using the following indexes:

CREATE INDEX authorIndex ON Intermediate(author_id);
CREATE INDEX bookIndex ON Intermediate(book_id);

I need a third index to not allow duplicated data in my table:

CREATE UNIQUE INDEX blablabla ON Intermediate(author_id, book_id);

I'd like to know if, using the third index I can delete one of the
first. Maybe both?

Thank you! Bye!

--
Silas Justiniano - Brazil

#2Richard Huxton
dev@archonet.com
In reply to: Silas Justiniano (#1)
Re: Indexes again

Silas Justiniano wrote:

Sorry, I'll remake (rewrite? redo? ... bad English :/ ) my question:

I have Books, Authors and Intermediate table. At intermediate I'm
currently using the following indexes:

CREATE INDEX authorIndex ON Intermediate(author_id);
CREATE INDEX bookIndex ON Intermediate(book_id);

I need a third index to not allow duplicated data in my table:

CREATE UNIQUE INDEX blablabla ON Intermediate(author_id, book_id);

I'd like to know if, using the third index I can delete one of the
first. Maybe both?

You can probably delete authorIndex without impacting performance too much.

--
Richard Huxton
Archonet Ltd

#3Silas Justiniano
silasju@gmail.com
In reply to: Richard Huxton (#2)
Re: Indexes again

I know understand. Thank you ;)

On 2/2/06, Richard Huxton <dev@archonet.com> wrote:

Silas Justiniano wrote:

Sorry, I'll remake (rewrite? redo? ... bad English :/ ) my question:

I have Books, Authors and Intermediate table. At intermediate I'm
currently using the following indexes:

CREATE INDEX authorIndex ON Intermediate(author_id);
CREATE INDEX bookIndex ON Intermediate(book_id);

I need a third index to not allow duplicated data in my table:

CREATE UNIQUE INDEX blablabla ON Intermediate(author_id, book_id);

I'd like to know if, using the third index I can delete one of the
first. Maybe both?

You can probably delete authorIndex without impacting performance too much.

--
Richard Huxton
Archonet Ltd

--
Silas Justiniano - Brazil