Speedup appData::objectGetEntries()
This commit is contained in:
committed by
WineHQ
parent
9ad365e1bd
commit
5d030f8b2d
@@ -332,13 +332,30 @@ class appData
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT DISTINCT appData.* FROM appData, appFamily, appVersion
|
if($iStart || $iRows)
|
||||||
WHERE
|
$sLimit = " LIMIT ?,?";
|
||||||
appVersion.appId = appFamily.appId
|
|
||||||
|
$sQuery = "(SELECT DISTINCT appData.* FROM appData,
|
||||||
|
appFamily, appVersion WHERE
|
||||||
|
appFamily.appId = appVersion.appId
|
||||||
AND
|
AND
|
||||||
(
|
(
|
||||||
appData.appId = appFamily.appId
|
appData.appId = appFamily.appId
|
||||||
OR
|
)
|
||||||
|
AND
|
||||||
|
appVersion.queued = 'false'
|
||||||
|
AND
|
||||||
|
appFamily.queued = 'false'
|
||||||
|
AND
|
||||||
|
appData.queued = '?'
|
||||||
|
AND
|
||||||
|
appData.type = '?'$sLimit) UNION
|
||||||
|
(
|
||||||
|
SELECT DISTINCT appData.* FROM appData,
|
||||||
|
appFamily, appVersion WHERE
|
||||||
|
appFamily.appId = appVersion.appId
|
||||||
|
AND
|
||||||
|
(
|
||||||
appData.versionId = appVersion.versionId
|
appData.versionId = appVersion.versionId
|
||||||
)
|
)
|
||||||
AND
|
AND
|
||||||
@@ -348,17 +365,19 @@ class appData
|
|||||||
AND
|
AND
|
||||||
appData.queued = '?'
|
appData.queued = '?'
|
||||||
AND
|
AND
|
||||||
appData.type = '?'";
|
appData.type = '?'$sLimit)";
|
||||||
if(!$iRows && !$iStart)
|
if(!$iRows && !$iStart)
|
||||||
{
|
{
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false", $sType);
|
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false", $sType,
|
||||||
|
$bQueued ? "true" : "false", $sType);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if(!$iRows)
|
if(!$iRows)
|
||||||
$iRows = appData::objectGetEntriesCount($bQueued ? "true" : "false",
|
$iRows = appData::objectGetEntriesCount($bQueued ? "true" : "false",
|
||||||
$bRejected, $sType);
|
$bRejected, $sType);
|
||||||
$sQuery .= " LIMIT ?,?";
|
|
||||||
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false", $sType,
|
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false", $sType,
|
||||||
|
$iStart, $iRows,
|
||||||
|
$bQueued ? "true" : "false", $sType,
|
||||||
$iStart, $iRows);
|
$iStart, $iRows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user