I have had to update the php.ini max execution time to 300 seconds for the below script to complete. Has anyone run into long running queries where they were able to improve performance by tuning the query? Any help on this would be greatly appreciated. Thank you,
PHP Code:
$query = "SELECT a.Vertical__c From Account a Where a.Status__c Like 'Active%'
ORDER BY a.Vertical__c ASC";
$options = new QueryOptions(2000);
$queryResult = new QueryResult($response);
!$done = false;
if ($queryResult->size > 0)
{
while (!$done)
{
foreach ($queryResult->records as $record)
{
if (!$record->fields->Vertical__c =="")
{
$vertArray[]=$record->fields->Vertical__c;
}
}
if ($queryResult->done != true)
{
// Get Next Batch of Records
try
{
$response = $mySforceConnection->queryMore($queryResult->queryLocator);
$queryResult = new QueryResult($response);
}
catch (Exception $e)
{
print_r($mySforceConnection->getLastRequest());
echo $e->faultstring;
}
}
else
{
$done = true;
}
}
}
}
$dbarray = array_unique($vertArray);
Bookmarks