How to load nested comments efficiently with pagination via MySQL in laravel?

2021.10.23 13:43 FabianDR How to load nested comments efficiently with pagination via MySQL in laravel?

Think of a comment system like reddit.
comment table:

- id - username - parent_reply_id - content
So each comment knows whether it has a parent and which. The question is: How do I go about loading the nested comments efficiently with pagination?
What I do at the moment: I load the latest 20 comments that don't have a parent. Then I go through each of them recursively and load their children and their children and so on. This way I have pagination, but A LOT of queries. Now I know I could load all comments at once and then order them correctly, but what if a have tens of thousands of comments in one thread? Doesn't sound very efficient to me.
Also: Should I cache these comments? I use Redis for caching, but I don't know if it's worth to cache paginated comments for a minute or two...
thanks!
submitted by FabianDR to laravel [link] [comments]


2021.10.23 13:43 hotbody33 I’ve used all mine

Can anyone in the Earnin Community help me boost my Max? 🙂 https://earnin.app.link/maEHTkjbu9
submitted by hotbody33 to Earnin [link] [comments]


2021.10.23 13:43 Injustice2gamer_YO looking for new players to join I guess

just looking for new people or semi new people that might need help with anything
submitted by Injustice2gamer_YO to GhostReconBreakpoint [link] [comments]


2021.10.23 13:43 AutoNewspaperAdmin [NZ] - Herald morning quiz: October 24 | NZ Herald

[NZ] - Herald morning quiz: October 24 | NZ Herald submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.10.23 13:43 TisRevolutionTime Lil furby burby

Lil furby burby submitted by TisRevolutionTime to youngpeopleyoutube [link] [comments]


2021.10.23 13:43 elbageluno Pseudo Saturn backups with foil tape

Hello, I have the black Pseudo Saturn cart. I saw on the website if you put foiltape on the inside, it can make games work that previously didnt (magic knight rayearth for example). I did this and I am still having trouble getting certain games to work MKR, PDS, PDZ (yes I patched the latter two) Even games that are said to be fully compatible on the website do not work on my model 1 saturn using Verbatim discs. I stuck the foil tape on the inside (sticky side facing the front, foil side facing PCB) Any help is appreciated. This is the site I'm getting my info from. https://ppcenter.webou.net/pskai/compat/
submitted by elbageluno to SegaSaturn [link] [comments]


2021.10.23 13:43 reanimate-shred Need class help!

Looking to build a character loosely based off of the game 'moonlighter' and am not sure what class/es to build! He'll be level 7.
If you haven't played the game, the basic idea is that he is adventuring to collect monster parts/items/magic items to sell at a shop left to him by his Great Uncle.
submitted by reanimate-shred to 3d6 [link] [comments]


2021.10.23 13:43 AutoNewspaperAdmin [NZ] - Covid 19 Delta outbreak: First case of Delta in South Island should 'boost vaccination rates' | NZ Herald

[NZ] - Covid 19 Delta outbreak: First case of Delta in South Island should 'boost vaccination rates' | NZ Herald submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.10.23 13:43 CynicTheCritic Kyoto Nights - 京都 'ローファイ', We make original, animated music mixes! Let us know what you think!

Kyoto Nights - 京都 'ローファイ', We make original, animated music mixes! Let us know what you think! submitted by CynicTheCritic to MusicForConcentration [link] [comments]


2021.10.23 13:43 ShanekaDevorer The struggles of selling a microphone online

The struggles of selling a microphone online submitted by ShanekaDevorer to mildlyinfuriating [link] [comments]


2021.10.23 13:43 d1sregard Carb in whisky

Can't seem to find a definite answer on this basic question but is whisky the same as rum when it comes to added sugar after distillation?
Craving some Canadian whisky right now and can't find an hydrometer test or anything online regarding carbs content.
submitted by d1sregard to keto [link] [comments]


2021.10.23 13:43 AutoNewspaperAdmin [National] - Missing Colorado mom, 39, found living on New York City streets | NY Post

[National] - Missing Colorado mom, 39, found living on New York City streets | NY Post submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.10.23 13:43 Fidixx HOWTO disable success notifications on the Screen.

Is there a Way to disable success notifications for successful Upgrade an Item?
submitted by Fidixx to ElyonOnline [link] [comments]


2021.10.23 13:43 ThrowawayRA1212121 UPDATE: My (21m) ex-girlfriend (19f) is giving mixed signals

tl;dr: ex-girlfriend left me for a weekend with her bible professor after saying it was nothing
So like I said in my last post, she had been giving me mixed signals, saying she wanted to be close together again while at the same time saying she couldn't be with me. She begged for me to come home to the apartment we lived together in, despite the fact she made me move out. I almost agreed, and then found something damning. A few months ago, she had emotionally cheated on me with someone and said that if I needed to I could sync my iPad which I never use with her phone, as a 'proof' she isn't cheating.
We both knew that I had had this, and yet she forgot. She had convinced her 30+-year-old ex-bible professor from a University she used to go to to buy a plane ticket and come visit her. Since I hadn't been updating the iPad I only had the day's texts of him boarding the flight and sending her the confirmation number, as well as flirtatious remarks. A few weeks ago I found that she had been deleting messages with this same guy, and I confronted her about it and she said that it was only because she was worried I'd get jealous despite the fact there was no emotional attachment, and she only talked to him for advice.
It feels terrible to see that she's moving on so soon, and even worse because yesterday after we had met up for me to collect my things, she told me she loved me and after 2-3 days she would contact me with a final verdict, but asked me to please not contact her or try to visit her for that time period.
She ended our conversation after I called her out with, "I never cheated on you because now we're broken up so it's okay."
I got played. :/
submitted by ThrowawayRA1212121 to relationship_advice [link] [comments]


2021.10.23 13:43 22101995 What is your favourite reddit community and why?

submitted by 22101995 to AskReddit [link] [comments]


2021.10.23 13:43 Straightener78 When our daughters made us Swiss roll on beans for breakfast.

When our daughters made us Swiss roll on beans for breakfast. submitted by Straightener78 to 80s [link] [comments]


2021.10.23 13:43 AllaChitarra Comment former de bons Québécois

Comment former de bons Québécois submitted by AllaChitarra to Quebec [link] [comments]


2021.10.23 13:43 spookyghostkitty Built in 1930, what is the style? It has farmhouse vibes, but are there different types of “farmhouse?”

Built in 1930, what is the style? It has farmhouse vibes, but are there different types of “farmhouse?” submitted by spookyghostkitty to Oldhouses [link] [comments]


2021.10.23 13:43 BitchImRetarded What ammo do you guys EDC?

Fairly new to CCW and just curious what is most popular for defensive ammo round these parts.
submitted by BitchImRetarded to CCW [link] [comments]


2021.10.23 13:43 thomasJEROMEnewton HALLOWEEN (mixtape)

HALLOWEEN (mixtape) submitted by thomasJEROMEnewton to halloween [link] [comments]


2021.10.23 13:43 Vast_Competition6595 Unemployment

The “as of” date on my transcript finally changed from May 31st to October 18th. But nothing else changed on the transcript. Anyone know why?
submitted by Vast_Competition6595 to IRS [link] [comments]


2021.10.23 13:43 LisaAshlie Dallas 1872 who would have thought it would grow up so fast

Dallas 1872 who would have thought it would grow up so fast submitted by LisaAshlie to Dallas [link] [comments]


2021.10.23 13:43 darkgoat16 Water is so soft / Yet it can erode mountains / With time and patience

submitted by darkgoat16 to haiku [link] [comments]


2021.10.23 13:43 AideAvailable5002 What is it

What is it submitted by AideAvailable5002 to mushroomID [link] [comments]


2021.10.23 13:43 JakeZero69 Looney la looney

Looney la looney submitted by JakeZero69 to lostpause [link] [comments]


http://studio12-vlg.ru