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

  • SEARCH
  • Home
  • 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 7508773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:44:11+00:00 2026-05-29T22:44:11+00:00

my question is about selecting the best method to perform a job. i’ll present

  • 0

my question is about selecting the best method to perform a job. i’ll present the goal and my various solutions.

i have a list of items and a list of categories. each can belong to a number of categories.

items          (id, name, ...other fields...)
categories     (id, name, ...... )
category_items (category_id, item_id)

the items list is very large and is updated every 10 minutes (using cron). the categories list is fixed.

on my page, i’m showing a large list of items and i have category filters. the whole filtering is done on client side javascript. The reason is that the items that are currently available are limited to +- 1000, so all the data (items+categories) will be loaded together.

this page is about to be viewed many times, so performance is an issue here. I have several ideas, both will result in a good performance. in all of them, the complete list of categories will be sent. the items however…

  1. running a single select using join and group_concat. something like this:

    SELECT i.*, GROUP_CONCAT(ci.category_id SEPARATOR “,”) AS category_list
    FROM items AS i
    LEFT JOIN category_items AS ci ON (ci.item_id = i.id)
    WHERE … GROUP BY i.id ORDER BY …

  2. creating a view with the above

  3. storing the GROUP_CONCAT result as an additional column. this will only be updated every several minutes under cron.

indexing is done correctly so all methods will work relatively fast. join is a heavy operation, so my question is about (2), (3):

is the view updated only on every CRUD or is it calculated on every select? if it is only updated on CRUD, it should be about the same as storing the column.

take in mind that the items table will grow, and only latest rows will be selected.

  • 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-29T22:44:13+00:00Added an answer on May 29, 2026 at 10:44 pm

    Solution 4. Have a MEMORY type table, which will be updated with results of your query from solution 1, by the same cron script, that updates items table.

    Other than that: 1. and 2. are equivalent. MySQL’s views are not materialised, so querying the view will actually run the SELECT from point 1.

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

Sidebar

Related Questions

I have some question about XML columns: when we selecting a XML column and
I have a basic question about selecting counts: If I have a table ContentTable
I have a jquery question about selecting Id. Basically, I call a javascript function
I have a question about selecting selectboxes with Javascript. I have upload the files
Question about Eclipse RCP and whole perspective/view/editor design - what is the best way
Question about GridView sorting in VB.NET: I have a GridView with AutoGenerateColumns = True
This question about Timers for windows services got me thinking: Say I have (and
I have a question about PHP Class. I am trying to get the result
This is likely a novice question about LINQ, but assuming I have a set
This is related to my previous question about selecting visible elements . Now, here's

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.