lawrence_dev
asked on
Is a For Each statement beneficial on this Left Join?
Is it possible to use a For Each statement on this query to conserve server memory? If yes, How do I add the For Each statement to this query?
The primary download has over 100,000 records. The options table has over 100,000 records. My server has 16GB of Ram but this left join uses about 9GB of RAM. I am joining Sku and ParentSku columns.
The primary download has over 100,000 records. The options table has over 100,000 records. My server has 16GB of Ram but this left join uses about 9GB of RAM. I am joining Sku and ParentSku columns.
$query1 = $conn->query('SELECT * FROM `download`
LEFT JOIN `options`
USING (ParentSKU)');
while ($row1 = $query1->fetch(PDO::FETCH_ASSOC))
{
echo $row1['ProductName']." ".$row1['Choice']."<BR>";
}
ASKER
Thanks Arnold!
I chose ProductName and Choice just to make sure I was getting data from both tables.
The download table has 26 columns and the options table has 4. I need to extract all data and merge both tables to upload to my online store.
I was thinking that a For Each statement would echo 1 complete row at a time and then go to the next...
I am open for ideas!!! Thanks again for your help!
I chose ProductName and Choice just to make sure I was getting data from both tables.
The download table has 26 columns and the options table has 4. I need to extract all data and merge both tables to upload to my online store.
I was thinking that a For Each statement would echo 1 complete row at a time and then go to the next...
I am open for ideas!!! Thanks again for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great Ideas! Thanks for your help!
Why not just select the ProductName and the Choice from their respective tables EX. download.ProductName,optio
This should reduce the amount of memory needed to retain the large output.