Closed (fixed)
Project:
User Points
Version:
7.x-1.x-dev
Component:
Code: userpoints_basic
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 May 2010 at 19:00 UTC
Updated:
6 Mar 2011 at 12:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
colin49 commentedComment #2
colin49 commentedComment #3
kbahey commentedI need opinions from others whether this use case is generic enough to include the patch in the base module.
Comment #4
berdir@colin49: #857712: How can add a user ranking based on the module Userpoints? is a feature request for adding a ranking, probably similiar to what you have done for your site. Are you interested in sharing your code? I guess if it is a feature of userpoints.module, it does make sense to add an index. If there is no query in userpoints.module that does actually use that index, I'd say it shouldn't be added.
Comment #5
cafuego commentedActually, I'd like to have that index as well, plus a bunch more :-)
I run two queries in the userpoints_evaporate module that have the userpoints.points field in a WHERE clause and without an index performance is totally woeful. I've added the index by hand here to resolve the issue, but it would be good to have it added upstream.
The other fields that would probably benefit from an index for people that might want to query them directly or join on them are:
userpoints.uid
userpoints_txn.uid
userpoints_txn.approver_uid
userpoints_txn.points
The attached patch updates hook_schema and adds an update() hook to create these indexes.
Comment #7
berdirNo idea why the patch doesn't apply...
- Comment is missing here.
- I know that the existing update functions are named wrong, but this should be 600X nevertheless :)
Note: I usually only commit patches for D7, so if you can provide a patch for Drupal 7 too, I'll commit that one.
Powered by Dreditor.
Comment #8
cafuego commentedOk, so that patch was all wrong; I'd made it against HEAD and not 6.x-1.x. First off, here is the proper 6.x patch.
6.x-1.x already had a compound index on userpoints.uid and userpoints.tid and that is used in a WHERE clause on uid as well, so there is no need for an extra uid index on that table.
Comment #9
cafuego commented.. and here is the same patch, rolled for 7.x-1.x.
Comment #10
berdirThanks, commited to 7.x-1.x.
Back to 6.x-1.x...
Comment #11
robby.smith commentedsubscribing
Comment #12
YK85 commentedsubscribe
Comment #13
MasterChief commentedA reason for patch in #8 wasn't commited ?
Comment #14
cafuego commentedFixing the issue title. Sorry, it bugs me.
Comment #15
berdirCommited, back to 7.x, the update function 7.x needs to be made conditional now so that it doesn't try to add the indexes twice.
Comment #16
cafuego commentedAttached is a patch that turns the db_add_index() calls in 7.x into conditionals, so that if a user has added indexes in D6 they won't get an error when upgrading to D7.
Comment #17
berdirGreat, thanks! Commited.