Query optimization

vgarvardt - May 30, 2008 - 14:04
Project:Login Ticket API
Version:5.x-1.5
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

Not a bug actually, but minor optimization feature.

loginticket.module, string 68-69, query:
SELECT * FROM {loginticket} WHERE passcode_md5 = '%s' AND purpose = '%s'
but passcode_md5 is PRIMARY KEY for loginticket table, so it is unique and second part of sql query condition is obsolete.

#1

jpetso - May 30, 2008 - 22:13

Hm... actually, I think that passcode_md5 and purpose should probably make up the primary key together, as the purposes (say, different API users) should be completely independent from each other. Well, just one reason more to replace passcode_md5 by a "real" incrementing id number.

#2

crdant - April 30, 2009 - 02:54
Status:active» fixed

Primary key has changed to a serial ticket_id, but in order to prevent possible collisions I've left a unique index on password_md5. This makes this optimization still valid, so I've updated the code to include it.

#3

System Message - May 14, 2009 - 03:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.