Scroll to top

24/11/2025

The home on the web of Colin Walker. Find out more on /about, say /hello, or sub to the daily RSS feed.

2025/11/24#p1

0 comments: click to leave a comment

I spent some time looking at the database queries triggered by the blog page and how I could optimise them. I know, exciting stuff!

There were some similar queries which I was able to condense by only running the larger and processing the results to get the relevant subset rather than making separate queries. By moving a couple, I was able to avoid repeated calls and use the same result in multiple places.

The way the code was structure very much reflected the way it was built — piecemeal, focusing on each function as a separate process, instead of holistically. I'm surprised it's taken nearly five years for me to address this.

With some help from ChatGPT and bashing my head against the wall, I also managed to streamline the way comments (and replies to comments) into a single query with a bit of logic to separate them out for display.

Much better.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



Close