I sail the high seas of the Lemmyverse, posting snarky + Lefty comments

  • 0 Posts
  • 9 Comments
Joined 2 years ago
cake
Cake day: May 7th, 2023

help-circle




  • subversive_dev@lemmy.mltoAnnouncements@lemmy.mlLemmy AMA March 2025
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 month ago

    Good evening Dessalines, I have started looking at the posts query.

    The lowest hanging fruit I think would be if we could replace some of the joins with WHERE EXISTS which can have a huge impact on the query time. It seems this is supported in Diesel: https://stackoverflow.com/a/74300447

    This is my first time looking at the codebase so I can’t tell yet which joins are purely for filtering (in which case they can be replaced by WHERE EXISTS) and which joins need to be left in because some of their columns end up in the final SELECT

    I can’t tell for sure yet but it also looks like this might also be using LIMIT...OFFSET pagination? That can be a real drag on performance but isn’t as easy to fix.

    EDIT:

    Looking some more, and reading some linked github discussion - I think to really get this out of the performance pits will require some denormalization like a materialized view or manual cache tables populated by triggers. I really like the ranking algorithm but so far I’m finding it difficult to optimize from a query perspective





  • Hard to say right now. The article suggests that the banks are just trying to free up cash on their balance sheets. However, this could instead be an indication that they are looking for a “bigger fool” to take the losses. I personally think the bottom won’t fall out of Xitter until the tesla share price crashes. Elon bought some time with credulous fools with the ridiculous cybercab demo, but that can’t last forever. At that point I think the only question is whether SpaceX gets pulled down with all the rest of the musk ventures