Closed
Bug 579096
Opened 14 years ago
Closed 13 years ago
add an autoinc for collections insertions
Categories
(Cloud Services Graveyard :: Server: Sync, defect)
Cloud Services Graveyard
Server: Sync
Tracking
(Not tracked)
RESOLVED
WONTFIX
Future
People
(Reporter: tarek, Assigned: tarek)
Details
Attachments
(1 file)
1.90 KB,
patch
|
telliott
:
review+
|
Details | Diff | Splinter Review |
To avoid the select max() done before an insertion, let's use an autoinc in collections. MySQL will increment a distinct counter per userid as long as collectionid is an autoincrement and part of the composed key. CREATE TABLE collections ( userid INT NOT NULL, collectionid INT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (userid,collectionid) ) ENGINE=MyISAM; This alter could be done in the current version, and the PHP server changed consequently (remove the select(max) done before the insert).
Comment 1•14 years ago
|
||
This seems fine, but be aware that I believe it makes MySQL5 a requirement for external installations, since I don't think this was a supported feature in 4. What would probably be better actually would be to have a mysql_mozilla storage type and a mysql storage type that doesn't bother with the extra collections table. Most people don't need this scaling optimization.
Comment 2•14 years ago
|
||
MySQL 5 is what, five years old now? I don't think that's an unfair baseline, for people who aren't running the minimal server.
Comment 3•14 years ago
|
||
Tarek, can you fix this? I think MySQL 5 is a perfectly cromulent min req.
Assignee: telliott → tarek
Comment 4•14 years ago
|
||
The barrier here isn't the fix, which is pretty easy - it's that it's not backwards-compatible with the various installs already out there. We should defer it to the 1.5 push.
Assignee | ||
Comment 5•14 years ago
|
||
Changing the milestone accordingly -- The patch follows
OS: Linux → All
Hardware: x86 → All
Target Milestone: --- → 1.5
Assignee | ||
Comment 6•14 years ago
|
||
The patch is written, but it turns out this feature only works for MyISAM. InnoDB does not have this. What engine does our production uses for this table ? Since inserting new collections is quite a rare event, MyIsam should be fine. In any case, until we get different client-side behaviors, all reads occur in the hardcoded array with the current clients, so it doesn't make a big difference right now. This change is more future-proof though, in case we have more arbitrary collection creations. Now about backward-compat for the masses: I propose that the next version includes in the Database schema a version number, so we're able to provide DB upgrade scripts like what we'll have in Python. The next version of the minimal and full PHP servers can provide a first upgrade script. This will also make it simpler for people to move from one of the PHP servers to the Python server without losing their data: the python server will recognize the DB version and upgrade it if needed.
Assignee | ||
Comment 7•14 years ago
|
||
This makes the code uses MyIsam multiple keys autoincrement feature. No DB upgrade script yet, waiting for Toby/Mike feedback before diving into this
Attachment #475477 -
Flags: review?(telliott)
Comment 8•14 years ago
|
||
Comment on attachment 475477 [details] [diff] [review] Patch for auto_increment in the collections table This will work, but it does have all the dangers you've already noted. I would suggest that we hold it for the python version, since that provides a nice break where the user is going to have to do a bunch of stuff anyway, and this isn't an area where the inefficiency is causing us problems right now.
Attachment #475477 -
Flags: review?(telliott) → review+
Updated•14 years ago
|
Target Milestone: 1.5 → Future
Assignee | ||
Comment 9•13 years ago
|
||
This is a minor improvement as adding per-user collections is not done by the clients. I am marking it as won't fix
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Updated•1 year ago
|
Product: Cloud Services → Cloud Services Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•