The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I'm teaching mysql sql now and wanted to know if i have undestood the indexpart right.
I have a query [sql] SELECT r_invites.*, user.username FROM " . TABLE_PREFIX . "r_invites LEFT JOIN " . TABLE_PREFIX . "user AS user USING(userid) where userid = " . $vbulletin->userinfo['userid'] . " ORDER BY r_invitesid DESC [/sql] should now the useridcolumn have a index to be faster because its in the where part? 2. example: [sql] SELECT * FROM " . TABLE_PREFIX . "link where catid = ". $catid . " order by linkid DESC [/sql] here the catid should have one or? |
|
#2
|
||||
|
||||
|
You are correct. Indices should be placed on columns that are compared two - however, over use and you will waste space. (Remember that primary keys are indexed automagically.)
|
|
#3
|
|||
|
|||
|
thx
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|