diff options
| author | 2014-07-07 18:25:48 +0200 | |
|---|---|---|
| committer | 2014-07-07 18:25:48 +0200 | |
| commit | 439a0e2991231db51232646736a4bf78cfb2bffd (patch) | |
| tree | 17cb1fad289521cbd75864390a6bd24694ee498d /app/Models/EntryDAO.php | |
| parent | 3bbd0e446f6a1a0c41a4db36d2841db36dc34004 (diff) | |
SQL: improved performance for adding new articles
Diffstat (limited to 'app/Models/EntryDAO.php')
| -rw-r--r-- | app/Models/EntryDAO.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 1775af63c..6f3f472f6 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -6,14 +6,18 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { return parent::$sharedDbType !== 'sqlite'; } - public function addEntry($valuesTmp) { + public function addEntryPrepare() { $sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, ' . ($this->isCompressed() ? 'content_bin' : 'content') . ', link, date, is_read, is_favorite, id_feed, tags) ' . 'VALUES(?, ?, ?, ?, ' . ($this->isCompressed() ? 'COMPRESS(?)' : '?') . ', ?, ?, ?, ?, ?, ?)'; - $stm = $this->bd->prepare($sql); + return $this->bd->prepare($sql); + } + + public function addEntry($valuesTmp, $preparedStatement = null) { + $stm = $preparedStatement === null ? addEntryPrepare() : $preparedStatement; $values = array( $valuesTmp['id'], |
