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 8970405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:43:25+00:00 2026-06-15T17:43:25+00:00

I have a function in a service that basically pulls the data from a

  • 0

I have a function in a service that basically pulls the data from a few tables and builds an index table.

The problem is that I have over 6000 records, so it just takes forever and sometimes reaches the memory limit.

Is there a design pattern or a method where I can achieve this either by a batch process or a web service? Ideally I want to be able to keep updating the user with the progress.

Any ideas or pointers would be really appreciated.

Update:

The tables I have are basically tables for use with products on an e-commerce site. I have the following tables:

  • Product (basic product information)
  • Product Description (descriptions and meta information)
  • Product Price (price information on a product)
  • Product Image (image information on a product)
  • Product Features (any product features)
  • Product Options (any product options)

I then have a Product Index table that pulls some of the information from all these tables for the purpose of making it much quicker and easier to search and filter results without the need of lots of joins.

I need some guidance on the best way to go about developing a method / function / process / service for rebuilding the index table.

  • 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-06-15T17:43:25+00:00Added an answer on June 15, 2026 at 5:43 pm

    I can’t tell you how to rebuild your index but I can show you a method I’ve been using for dealing with large result sets.

    $em = $this->getContainer()->get('doctrine')->getEntityManager();
    $repo = $em->getRepository('MyBundle:Item');
    $qb = $repo->createQueryBuilder('i') // build query ...
    
    // get iterator for query; this way only a single row is
    // hydrated at a time.
    $it = $qb->getQuery()->iterate();
    foreach ($it as $row) {
        // $row[0] will be the fetched entity.
        $ent = $row[0];
    
        // do stuff with entity ...
        // ...
    
        // Once you're done with the entity detach it to
        // save memory and speed up the doctrine ORM.
        // make sure you DO NOT use the detached entity
        // in any way after this call (unless you re-merge() it).
        $em->detach($row[0]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically i have a wcf service that returns a dataset of 2000 records. When
I have this class that tries multiple methods of getting data from Google maps
I have a function on my service that looks like something this: addStatement: function(user,
I have created a web service that is basically a json set of values
I made a Web service in which I have a function to count some
Hello I have next function, what always return null as result, but service calling
I have a WCF service with a function GetData() When my client calls this
I have checked with Aweber customers service and they told me their internal function
I have a REST-like PHP service and i don't understand how invoke function of
I have function LoadTempMovieList(), and need to load movies from sessionStorage. But it seems

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.