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.
(1)
  • (Score: 5, Insightful) by Bobs on Wednesday January 09 2019, @01:45PM

    by Bobs (1462) on Wednesday January 09 2019, @01:45PM (#784096)

    Thank you!

  • (Score: 5, Interesting) by realDonaldTrump on Wednesday January 09 2019, @02:02PM (22 children)

    by realDonaldTrump (6614) on Wednesday January 09 2019, @02:02PM (#784100) Homepage Journal

    The stories with a lot of Tweets, they go into so many Pages. Because the cyber -- they said -- was too slow. An the Pages are a big headache. As everyone knows. But the cyber is faster now. So possibly they don't need the Pages anymore. Hopefully they don't need those with the fast new digital.

    • (Score: 3, Interesting) by The Mighty Buzzard on Wednesday January 09 2019, @02:04PM (18 children)

      by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday January 09 2019, @02:04PM (#784101) Homepage Journal

      We might indeed be able to raise the 100 comment per page limit. It'll need some testing though.

      --
      My rights don't end where your fear begins.
      • (Score: 2) by zocalo on Wednesday January 09 2019, @02:12PM (7 children)

        by zocalo (302) on Wednesday January 09 2019, @02:12PM (#784102)
        Or actual stories with more than 100 comments. :)

        OK, I know there have been a few, but it's still pretty rare, but well done on spotting the missing index and taking the time to investigate further anyway. Faster load times = more time to read and comment!
        --
        UNIX? They're not even circumcised! Savages!
        • (Score: 2) by The Mighty Buzzard on Wednesday January 09 2019, @02:33PM (6 children)

          by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday January 09 2019, @02:33PM (#784109) Homepage Journal

          Ten in the last thirty days. Two of them journal entries. That's not bad for us for a month heavy on holiday stuff.

          --
          My rights don't end where your fear begins.
          • (Score: 5, Funny) by Runaway1956 on Wednesday January 09 2019, @02:55PM (5 children)

            by Runaway1956 (2926) Subscriber Badge on Wednesday January 09 2019, @02:55PM (#784116) Journal

            heavy on holiday stuff

            I told you I'd be back to help you finish off the ham, and all those pies. But, did you listen? Noooooooooooo - you ate it all yourself. Now you're gonna complain about heavy? I don't wanna hear it. No sympathy from me that you have to turn sideways to get through the door.

            • (Score: 3, Touché) by The Mighty Buzzard on Wednesday January 09 2019, @03:11PM (4 children)

              by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Wednesday January 09 2019, @03:11PM (#784127) Homepage Journal

              Man, I only put on five pounds between the big food holidays and having to eat more often for ten days of thrice-a-day antibiotics. Since I lost 35 pounds or so over the past year, I'm calling that a win.

              --
              My rights don't end where your fear begins.
              • (Score: 2) by Runaway1956 on Wednesday January 09 2019, @04:50PM (3 children)

                by Runaway1956 (2926) Subscriber Badge on Wednesday January 09 2019, @04:50PM (#784167) Journal

                Ugghhhh - hate those meds. And, they suck even more during the holiday season.

                • (Score: 2) by The Mighty Buzzard on Thursday January 10 2019, @04:09AM (2 children)

                  by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday January 10 2019, @04:09AM (#784457) Homepage Journal

                  First time I've taken any since my 20s. They're just as annoying now as then. And the dipshit PA felt the need to prescribe me not one but two bloody decongestants after I told him the infection had my sinuses the clearest they had been in decades.

                  --
                  My rights don't end where your fear begins.
                  • (Score: 2) by Runaway1956 on Thursday January 10 2019, @02:35PM (1 child)

                    by Runaway1956 (2926) Subscriber Badge on Thursday January 10 2019, @02:35PM (#784496) Journal

                    Sinuses? Try scuba diving. They gave me hell through my teens. Guess I was 20, almost 21 when I took my diving lessons. We got out of the kiddy pool, and went on our first real dive, diddling around at around fifty feet. My ears popped, and I started running at the nose, head felt weird, and I headed to the surface. I was a god-awful mess for a couple hours, but I've never had sinus problems like I did in my teens. I suppose if I had ever described the experience to a nose-throat-and-ear specialist, he could have explained it. All I know is, life changed when I took up diving.

      • (Score: 3, Interesting) by takyon on Wednesday January 09 2019, @03:22PM (6 children)

        by takyon (881) <takyonNO@SPAMsoylentnews.org> on Wednesday January 09 2019, @03:22PM (#784136) Journal

        Wouldn't this break existing URLs that link to specific pages?

        --
        [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
        • (Score: 2) by kazzie on Wednesday January 09 2019, @04:41PM

          by kazzie (5309) Subscriber Badge on Wednesday January 09 2019, @04:41PM (#784161)

          Are there (m)any of those?

          I suppose one could only raise the bar on stories newer than $date to maintain compatibility.

        • (Score: 3, Informative) by martyb on Wednesday January 09 2019, @11:19PM

          by martyb (76) Subscriber Badge on Wednesday January 09 2019, @11:19PM (#784330) Journal

          Wouldn't this break existing URLs that link to specific pages?

          tl;dr: Depends on what you mean by 'existing'. A URL containing a page reference that you had saved away, say, as a bookmark could be a problem. But any accesses to different pages while a given page size is in effect should work fine.

          Try it! Logged-in users can already set a preference for how many comments they want to see in a page:

          1. Go to your user page: https://soylentnews.org/users.pl [soylentnews.org]
          2. Click on the "Comments" button.
          3. The 5th choice in the "Comment Settings" section is "Comment Limit".

            Comment Limit [100]
            Only display this many comments per page (or slightly more to keep threads from splitting). If set above 100, then it is ignored and this value is used instead.

          4. Set the Comment Limit to a small value, e.g. 10.
          5. Scroll to the bottom of the page and click the "Save" button.
          6. Reload this story: Meta: Late Christmas Present [soylentnews.org].

          See your new page size in effect.

          Now, given all that... if you had previously saved a link to a comment externally that referred to a particular 'page' of comments, and then tried to open that link with a new page size in effect, then, well that won't work.

          --
          Wit is intellect, dancing.
        • (Score: 2) by The Mighty Buzzard on Thursday January 10 2019, @04:10AM (3 children)

          by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday January 10 2019, @04:10AM (#784459) Homepage Journal

          If you're linking to specific pages, you're doing it wrong. How many are on a page is up to each individual user, so you can't have any idea what page a given comment is on.

          --
          My rights don't end where your fear begins.
      • (Score: 3, Funny) by RandomFactor on Wednesday January 09 2019, @10:54PM (1 child)

        by RandomFactor (3682) Subscriber Badge on Wednesday January 09 2019, @10:54PM (#784320) Journal

        You.... You understood that.

        --
        В «Правде» нет известий, в «Известиях» нет правды
      • (Score: 2) by Reziac on Thursday January 10 2019, @02:27AM

        by Reziac (2489) on Thursday January 10 2019, @02:27AM (#784420) Homepage

        Noticeable improvement -- it's always been slow to redisplay post-moderating, and now it's not. So you fixed something. There, aren't you glad I broke it? :D

        --
        And there is no Alkibiades to come back and save us from ourselves.
    • (Score: 0) by Anonymous Coward on Wednesday January 09 2019, @03:06PM (2 children)

      by Anonymous Coward on Wednesday January 09 2019, @03:06PM (#784123)

      I knew it!

      This can't be the readDonaldTrump because he speaks far too clearly and makes too much sense!

      • (Score: 0) by Anonymous Coward on Wednesday January 09 2019, @11:22PM

        by Anonymous Coward on Wednesday January 09 2019, @11:22PM (#784332)

        It's just another clone.

      • (Score: 3, Interesting) by realDonaldTrump on Thursday January 10 2019, @11:23PM

        by realDonaldTrump (6614) on Thursday January 10 2019, @11:23PM (#784718) Homepage Journal

        I'm a professional at Technology. I'm like really smart.

  • (Score: -1, Redundant) by Anonymous Coward on Wednesday January 09 2019, @05:22PM (8 children)

    by Anonymous Coward on Wednesday January 09 2019, @05:22PM (#784186)

    Glad you finally did your job!

    • (Score: 2) by pkrasimirov on Wednesday January 09 2019, @11:46PM (7 children)

      by pkrasimirov (3358) Subscriber Badge on Wednesday January 09 2019, @11:46PM (#784343)

      Yeah, he finally earned his salary, right?

      • (Score: 2) by The Mighty Buzzard on Thursday January 10 2019, @04:15AM (6 children)

        by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday January 10 2019, @04:15AM (#784462) Homepage Journal

        I think I'll demand a raise from NCommander tomorrow. It's a new year and inflation's made my $0 worth around 2% less.

        --
        My rights don't end where your fear begins.
        • (Score: 3, Interesting) by realDonaldTrump on Friday January 11 2019, @11:55AM (5 children)

          by realDonaldTrump (6614) on Friday January 11 2019, @11:55AM (#784983) Homepage Journal

          So many of our best workers -- and my biggest supporters -- work, very proudly, for free. Thank you! #ShutdownStories [twitter.com]

          • (Score: 2) by The Mighty Buzzard on Friday January 11 2019, @12:23PM (4 children)

            by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Friday January 11 2019, @12:23PM (#784993) Homepage Journal

            I don't really work for free. I get paid in interesting news, well above average discussions about it to participate in, and dumbass comments about it to mock.

            --
            My rights don't end where your fear begins.
            • (Score: 2) by edIII on Friday January 11 2019, @11:36PM (3 children)

              by edIII (791) on Friday January 11 2019, @11:36PM (#785290)

              Well that won't do.... You should start a GoFundMe for good Whiskey. I'd pitch in to buy you a drink :)

              --
              Technically, lunchtime is at any moment. It's just a wave function.
              • (Score: 2) by The Mighty Buzzard on Saturday January 12 2019, @03:54AM (2 children)

                by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Saturday January 12 2019, @03:54AM (#785379) Homepage Journal

                Nah, I'd just embezzle it and blow it all on fishing gear. Better to avoid the temptation.

                --
                My rights don't end where your fear begins.
                • (Score: 2) by edIII on Saturday January 12 2019, @08:27AM (1 child)

                  by edIII (791) on Saturday January 12 2019, @08:27AM (#785431)

                  But I thought good Whiskey was included in fishing gear...

                  --
                  Technically, lunchtime is at any moment. It's just a wave function.
                  • (Score: 2) by The Mighty Buzzard on Saturday January 12 2019, @11:34AM

                    by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Saturday January 12 2019, @11:34AM (#785462) Homepage Journal

                    Well, it can be but unlike beer it requires an additional hydration source and something sammich-like so you don't have to stop fishing. Whiskey's only part of your balanced breakfast not the whole thing.

                    --
                    My rights don't end where your fear begins.
  • (Score: 2, Interesting) by Anonymous Coward on Wednesday January 09 2019, @07:52PM (1 child)

    by Anonymous Coward on Wednesday January 09 2019, @07:52PM (#784250)

    With that discovery, I wonder if there are other missing indexes or with columns in the wrong order. Maybe you should try some EXPLAIN QUERY PLAN queries with your usual DML statements. That might also reveal instances where a covering index might be handy. An ANALYZE statement may also help your query planner (depending on your DB engine), but that may not be worth the minimal gain.

    • (Score: 1, Interesting) by Anonymous Coward on Thursday January 10 2019, @03:12AM

      by Anonymous Coward on Thursday January 10 2019, @03:12AM (#784437)

      Just an FYI: The statement EXPLAIN QUERY PLAN isn't standard SQL, so the exact command differs depending on the exact implementation you are using. Sometimes it is EXPLAIN QUERY PLAN, EXPLAIN ANALYZE, or EXPLAIN VERBOSE, among some of the other options.

  • (Score: 2) by Kilo110 on Wednesday January 09 2019, @08:13PM (3 children)

    by Kilo110 (2853) Subscriber Badge on Wednesday January 09 2019, @08:13PM (#784261)

    Where's my bitcoin subscription option?

    • (Score: 2) by Kilo110 on Wednesday January 09 2019, @08:15PM (2 children)

      by Kilo110 (2853) Subscriber Badge on Wednesday January 09 2019, @08:15PM (#784265)

      I'm blind.

      • (Score: 2) by Kilo110 on Wednesday January 09 2019, @08:22PM (1 child)

        by Kilo110 (2853) Subscriber Badge on Wednesday January 09 2019, @08:22PM (#784268)

        I went to subscribe with bitcoin and it didn't work. So my original comment still stands.

        • (Score: 2) by The Mighty Buzzard on Thursday January 10 2019, @04:25AM

          by The Mighty Buzzard (18) Subscriber Badge <themightybuzzard@proton.me> on Thursday January 10 2019, @04:25AM (#784469) Homepage Journal

          Stripe stopped supporting BTC around the time transaction fees became larger than a year's subscription here. Yes, we do need to remove the outdated info though.

          As for a new cryptocoin option, I'm a bit sick of dealing with trendy, short attention span assholes who think it's okay to have a non-versioned API and break backwards compatibility a couple times a year when you're dealing with people's money. If anyone wants to write up a plugin for their favorite "you pay in cryptocoins, SN gets cash money" service, I'll code review it and merge it. Hell, I'll even help if you need it. I'm not going to code any more modules to use an API that's not going to work in six months though.

          --
          My rights don't end where your fear begins.
  • (Score: 2) by linkdude64 on Wednesday January 09 2019, @09:19PM

    by linkdude64 (5482) on Wednesday January 09 2019, @09:19PM (#784275)

    Good goin'

  • (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*

    • (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.

(1)