Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Which field needs INDEX?

Quote Reply
Which field needs INDEX?
In TABLE Links, there are:
INDEX urlndx (URL),
INDEX catndx (CategoryID),
INDEX stndx (Status)

What do these lines for?
If I add some fields, how do I know which one needs INDEX?
Does it matter if some fields are in Chinese BIG5 characters?

Thanks!
Quote Reply
Re: Which field needs INDEX? In reply to
Alex will need to address the specifics of this, but the INDEX field is which fields are indexed.

If you are using foreign characters, you may not be able to use the Index for anything but the numerics.

Send Alex an Email -- he can miss forum posts.

Quote Reply
Re: Which field needs INDEX? In reply to
Indexes help speed up searches on those fields. However, if you do a search FIELD LIKE '%SOMETHING%', it won't do any speed up. You need to start with a letter, not a wildcard like % or _.

I don't think you should need to add any indexes unless you are doing something pretty custom.

Cheers,

Alex
Quote Reply
Re: Which field needs INDEX? In reply to
Here's a good example:

In the top_5 codes I posted, if you index the Last_Hit and Count fields, you increase performance by a STAGGERING amount!

The reason is that the SELECT statement is using those fields in an ordered manner ie: DESC

If you install that mod, try it in search.cgi without indexes (I had 4 look ups -- most recent, most common, today and yesterday) and my response time was pushing 8 seconds. With indexes, it's as fast as anything else on the site.