From 71f7ce1be5833b54b0f4e1f37e6557425c364725 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 1 Mar 2014 15:47:15 +0100 Subject: API: SQL optimisation https://github.com/marienfressinaud/FreshRSS/issues/13 --- p/api/greader.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index 035a031dd..d1846fdaf 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -403,17 +403,12 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude } $entryDAO = new FreshRSS_EntryDAO(); - $entries = $entryDAO->listWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', '', $start_time); + $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', '', $start_time); $itemRefs = array(); - foreach ($entries as $entry) { - $f_id = $entry->feed(); + foreach ($ids as $id) { $itemRefs[] = array( - 'id' => $entry->id(), //64-bit decimal - //'timestampUsec' => $entry->dateAdded(true), - /*'directStreamIds' => array( - 'feed/' . $entry->feed() - ),*/ + 'id' => $id, //64-bit decimal ); } -- cgit v1.2.3