Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORDER BY - where put indexes 1

Status
Not open for further replies.

nego78

Programmer
Jun 13, 2004
129
PL
Hi

i must sort this way

ORDER BY IF((Katalog_NowaOcena > 0 && Katalog_OcenaIlosc > 0),(Katalog_NowaOcena*Katalog_OcenaWartosc/Katalog_OcenaIlosc),IF(Katalog_NowaOcena > 0,Katalog_NowaOcena,(Katalog_OcenaWartosc/Katalog_OcenaIlosc))) DESC

where i should put indexes to reach max preformance (medium database - 200k records)

thanks in advance

Webdesign
 
There will be no indexes used there, so there will be no advantage in setting up any. If speed is, or is likely to become, a problem, then you might consider adding a field to your table containing the result of that calculation, and index that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top