Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4115168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:32:51+00:00 2026-05-20T22:32:51+00:00

I sorta get how memcached works. You use it store chunks of data to

  • 0

I sorta get how memcached works. You use it store chunks of data to improve site performance. When you want to retrieve some data you check if its in memcached first, if it is, then you retrieve it, otherwise you check your database/filesystem etc.

I just don’t know how/when to use it? What would be a good opportunity?

I have the following tables:

Author:

id username email password salt
email_salt email_verified
ip_address

Author_threads:

thread_id, author_id

Thread:

id, title, content, created

Tag:

id, name

Thread_tags:

tad_id, thread_id

I want to select the latest 30 threads, their author and all their tags. This is the SQL statement I use:

       SELECT thread.title, thread.id as thread_id,
       thread.content, author.username, author.id as author_id,
       GROUP_CONCAT(DISTINCT tag.name ORDER BY tag.name DESC SEPARATOR ',') AS tags
       FROM thread 
       JOIN thread_tags ON thread.id = thread_tags.thread_id
       JOIN tag ON thread_tags.tag_id = tag.id

       JOIN author_threads ON thread.id = author_threads.thread_id
       JOIN author ON author_threads.author_id = author.id

       GROUP BY thread.id DESC
       LIMIT 0, 30

This is the PHP that I use:

function get_latest_threads($link, $start)
{

   $start = minimal_int($start);

   $threads = sql_select($link, "SELECT thread.title, thread.id as thread_id,
                                 thread.content, author.username, author.id as author_id,
                                 GROUP_CONCAT(DISTINCT tag.name ORDER BY tag.name DESC SEPARATOR ',') AS tags
                                 FROM thread 
                                 JOIN thread_tags ON thread.id = thread_tags.thread_id
                                 JOIN tag ON thread_tags.tag_id = tag.id

                                 JOIN author_threads ON thread.id = author_threads.thread_id
                                 JOIN author ON author_threads.author_id = author.id

                                 GROUP BY thread.id DESC
                                 LIMIT $start, 30"  # I only want to retrieve 30 records each time
                        );

   return $threads;

}

Where/how would memcached be uses here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:32:51+00:00Added an answer on May 20, 2026 at 10:32 pm

    I just don’t know how/when to use it?

    Use it only once you have proved that adding caching is the best performance boost you can get. Adding data caching or output caching to a complex application that previously did not have any sort of caching can uncover a large number of subtle bugs and bizarre behavior.

    Use a code profiler first. Find out where your code is having real performance problems. Identify the bottlenecks and fix them. If that fix involves caching, so be it, but gather evidence first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a typedef equivalent in C#, or someway to get some sort of
How do I get a DateFormat of some sort to throw an exception if
I want to parse a config file sorta thing, like so: [KEY:Value] [SUBKEY:SubValue] Now
Our current project at work is a new MVC web site that will use
Basically what I'm trying to accomplish is I want to check multiple dynamic forms
Is there a htop/top on Linux where I get to sort processes by network
I can't get my GridView to enable a user to sort a column of
Is there a way to get the same sort of speedup on x64 architecture
I want to setup a statistics monitoring platform to watch a specific service, but
I sorta feel embarrassed because I am sure the answer to this is simple.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.