Stories
Slash Boxes
Comments

SoylentNews is people

Meta
posted by on Wednesday January 09 2019, @12:59PM   Printer-friendly
from the better-late-than-never dept.

While shutting down terminal windows to the SN servers this morning, one of them had the create table syntax for the comments table still on screen. I gave it a read through just because it was there and noticed that there wasn't an index for the opid (top level comment id for speeding up entire thread pulling) column. So I got some before numbers, added one, and ran some After tests. Heavily commented stories show a 50-150% pages-per-second speed increase in threaded views. Low hanging fruit FTW.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Funny) by ilsa on Wednesday January 09 2019, @10:44PM (2 children)

    by ilsa (6082) Subscriber Badge on Wednesday January 09 2019, @10:44PM (#784314)

    Sometimes all it takes is one small but critical detail.

    Reminds me of a developer who complained that one of the pages they wrote has started running slow and complained about the infrastructure being inadequate.

    After some investigation, it turned out they were doing a select * on blah without a where clause, and some recent work populated that table by several 100k rows. Well no kidding your query is going to run slow!

    The real kick in the pants was that the developer was only looking for ONE row. They were loading the entire table and then looping through the results till they found what they wanted. *facepalm*

    Starting Score:    1  point
    Moderation   +1  
       Funny=1, Total=1
    Extra 'Funny' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 2, Funny) by Anonymous Coward on Friday January 11 2019, @03:40AM (1 child)

    by Anonymous Coward on Friday January 11 2019, @03:40AM (#784871)

    I saw something like that once. They got all the results from an unindexed flat-file database, looped through it looking for what they wanted. The worst part is that the loop didn't break once it was found, they just continued looping.