![]() |
|
#1
|
|||
|
|||
Indexing tableHi do i have to use index in my table where there is a column Num. Which must be unique, for each person. I my files i have search form to search by Num too.
Do i have to set Num column to UNIQUE? and create index for faster search? __________________
Copyright by eRIC 2003 © !!! |
|
#2
|
||||
|
||||
|
UNIQUE is an index, so if the column data is unique to each row, then make it UNIQUE. Otherwise use EXPLAIN with your SELECT statement to see if the SQL is optimised to your table structure.
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
OkQuote:
__________________
Copyright by eRIC 2003 © !!! |
|
#4
|
||||
|
||||
|
eRIC,
Have you ever tried using EXPLAIN with your SELECT statements before? If you haven't, try inserting the word "EXPLAIN" to your SQL statement and see the results... For example, if your SQL is something like this: SELECT `name`, `number` FROM `client` WHERE `id`=256 try something like this instead: EXPLAIN SELECT `name`, `number` FROM `client` WHERE `id`=256 Paste the results if you want me to 'explain' the report/result... __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#5
|
|||
|
|||
|
Quote:
query: EXPLAIN SELECT `AdiTur` , `SicilNo` FROM `basa` WHERE `Id` =18 table | type |possible_keys |key| key_len|ref|rows|extra -------------------------------------------------------- basa const PRIMARY PRIMARY 4 const 1 ?????????? __________________
Copyright by eRIC 2003 © !!! |
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| customizing preprocessor and hash table | incognito54 | C Programming Language | 2 | 21-Apr-2004 18:25 |
| Trying to retrieve selective results from a table. | icsys | MySQL / PHP Forum | 9 | 18-Nov-2003 03:31 |
| Recall table row | misunderstood | MySQL / PHP Forum | 3 | 23-Aug-2003 08:56 |
| form in a table cell | blelisa | Web Design Forum | 1 | 19-Aug-2003 09:14 |
| [Tutorial] MySQL Basics | nniehoff | MySQL / PHP Forum | 15 | 23-Mar-2003 19:42 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The