Ask a Question related to ASP Database, Design and Development.
-
Laphan #1
Do I need INDEXes when a UNIQUE has been set?
Having re-jigged the UNIQUE to the proper syntax it does do what I want -
wahey!!
Just to finish this off here is my final table DDL:
CREATE TABLE `WEBSTRINGS` (
`STRINGID` INT NOT NULL AUTO_INCREMENT,
`TOKENID` INT DEFAULT 0,
`LANGID` VARCHAR(30),
`STRINGTEXT` VARCHAR(255),
`PAGEID` TINYINT UNSIGNED DEFAULT 0,
`GUI` TINYINT UNSIGNED DEFAULT 0,
INDEX `indxLANGID` (`LANGID`),
INDEX `indxGUI` (`GUI`),
INDEX `indxTOKENID` (`TOKENID`),
INDEX `indxSTRINGID` (`STRINGID`),
UNIQUE `unqSTRINGID` (`LANGID`,`STRINGTEXT`,`GUI`),
PRIMARY KEY `PrimaryKey` (`STRINGID`)
);
Do I really need the other INDEXes if I have this UNIQUE one set (and a PK)
?
What would be the pluses and minuses of keeping the indexes in realtion to
my ASP page work?
Thanks
Laphan
Laphan Guest
-
Unique Form inserting into many tables using unique id
I have a Registration Form that have 3 steps. The data could be inserted into many (4) tables. Some data corresponding to a one table (the main or... -
indexes in cs
Is it possible to easily create an InDesign index from a Word document? In other words, if the Word doc comes through with a special character... -
using indexes
quick question regarding proper use of indexes. there are options for asc/desc sorting for each column when creating the index - for optimal... -
Indexes
hello, here is my question. if you have a table called related_to and it has these fields: id active from_class_id from_id type_cid... -
Two indexes?
I'm doing a book with a long contributor index as well as a standard index. Is it possible to use ID's indexing feature for both, or am I limited to... -
Aaron [SQL Server MVP] #2
Re: Do I need INDEXes when a UNIQUE has been set?
> Do I really need the other INDEXes if I have this UNIQUE one set (and a
That really depends on your goal, and how your database implements a UNIQUE> PK)
> ?
constraint on a column.
In SQL Server, this would be redundant, since a unique constraint is
implemented as an index.
However, since you use the word AUTO_INCREMENT, I don't think this is SQL
Server at all. Have you considered asking in a forum dedicated to your
database platform?
In general, indexes:> What would be the pluses and minuses of keeping the indexes in realtion to
> my ASP page work?
- speed up sorting, bookmark lookups, and joins
- slow down inserts
With uniques in particular, they help to keep redundant data out of your
database.
So, as I said before, the "pluses and minuses" really depend on your
objective(s).
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Aaron [SQL Server MVP] Guest
-
Astra #3
Re: Do I need INDEXes when a UNIQUE has been set?
Hi Aaron
Thanks for coming back to me.
What I'm trying to understand is that isn't the unique already doing the job
of the index, so do I really need to create a separate index as well for
each of the fields/columns?
Rgds Robbie
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:OFNTSg4cEHA.1048@tk2msftngp13.phx.gbl...That really depends on your goal, and how your database implements a UNIQUE> Do I really need the other INDEXes if I have this UNIQUE one set (and a
> PK)
> ?
constraint on a column.
In SQL Server, this would be redundant, since a unique constraint is
implemented as an index.
However, since you use the word AUTO_INCREMENT, I don't think this is SQL
Server at all. Have you considered asking in a forum dedicated to your
database platform?
In general, indexes:> What would be the pluses and minuses of keeping the indexes in realtion to
> my ASP page work?
- speed up sorting, bookmark lookups, and joins
- slow down inserts
With uniques in particular, they help to keep redundant data out of your
database.
So, as I said before, the "pluses and minuses" really depend on your
objective(s).
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Astra Guest
-
Aaron [SQL Server MVP] #4
Re: Do I need INDEXes when a UNIQUE has been set?
> What I'm trying to understand is that isn't the unique already doing the
jobI thought I addressed that already:> of the index, so do I really need to create a separate index as well for
> each of the fields/columns?
"In SQL Server, this would be redundant, since a unique constraint is
implemented as an index."
I'm assuming SQL Server, but you still didn't tell us which database you're
using.
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Aaron [SQL Server MVP] Guest
-
Laphan #5
Re: Do I need INDEXes when a UNIQUE has been set?
Hi Aaron
It's a MySQL 4 DB.
Rgds Robbie
Aaron [SQL Server MVP] <ten.xoc@dnartreb.noraa> wrote in message
news:#Y7TzmKdEHA.3632@TK2MSFTNGP09.phx.gbl...job> What I'm trying to understand is that isn't the unique already doing theI thought I addressed that already:> of the index, so do I really need to create a separate index as well for
> each of the fields/columns?
"In SQL Server, this would be redundant, since a unique constraint is
implemented as an index."
I'm assuming SQL Server, but you still didn't tell us which database you're
using.
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Laphan Guest
-
Aaron [SQL Server MVP] #6
Re: Do I need INDEXes when a UNIQUE has been set?
Then you'll have to consult the MySQL folks. I've played with it but not
enough to know how they implement UNIQUE CONSTRAINTs.
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
"Laphan" <news@DoNotEmailMe.co.uk> wrote in message
news:41086723_3@127.0.0.1...> Hi Aaron
>
> It's a MySQL 4 DB.
>
> Rgds Robbie
Aaron [SQL Server MVP] Guest



Reply With Quote

