aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mssql_odbc.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-02-03 10:19:04 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-02-03 10:19:04 +0000
commit7b262babcd5c862c3068b08da8bba5f48bd5f36a (patch)
tree5b25f810cc36b33ba6ff406dab76377551e7688e /phpBB/includes/db/mssql_odbc.php
parente9e9e8e69c3aee47d5bfbc24b2fb9f335cddf36a (diff)
downloadforums-7b262babcd5c862c3068b08da8bba5f48bd5f36a.tar
forums-7b262babcd5c862c3068b08da8bba5f48bd5f36a.tar.gz
forums-7b262babcd5c862c3068b08da8bba5f48bd5f36a.tar.bz2
forums-7b262babcd5c862c3068b08da8bba5f48bd5f36a.tar.xz
forums-7b262babcd5c862c3068b08da8bba5f48bd5f36a.zip
Alright, this should give some improved performance :)
This is the end of random seek access to rows. If you have a compelling reason as to why they should stay, contact me. Else, they are gone forevermore... The following API calls are deprecated: acm::sql_rowseek() -> no replacement $db->sql_fetchfield($field, $rownum = false, $query_id = false) -> $db->sql_fetchfield($field, $query_id = false) Initial tests show that phpBB3 over four percent of memory against phpBB3.1 on an empty board. So far so good :) Other cool things: db2, MS SQL ODBC and MS SQL 2005 all use less memory because they do not need to reference the last executed query to handle random access seeks :) P.S. The crazy people using SVN: please report any issues with the new way we itterate through caches, I do not want to miss anything :) git-svn-id: file:///svn/phpbb/trunk@8372 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/mssql_odbc.php')
-rw-r--r--phpBB/includes/db/mssql_odbc.php54
1 files changed, 8 insertions, 46 deletions
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index a9a0b1bc1d..de96939035 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -31,7 +31,6 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
*/
class dbal_mssql_odbc extends dbal
{
- var $last_query_text = '';
var $dbms_type = 'mssql';
/**
@@ -139,7 +138,6 @@ class dbal_mssql_odbc extends dbal
$this->sql_report('start', $query);
}
- $this->last_query_text = $query;
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
@@ -204,7 +202,14 @@ class dbal_mssql_odbc extends dbal
// Seek by $offset rows
if ($offset)
{
- $this->sql_rowseek($offset, $result);
+ // We do not fetch the row for rownum == 0 because then the next resultset would be the second row
+ for ($i = 0; $i < $offset; $i++)
+ {
+ if (!$this->sql_fetchrow($result))
+ {
+ return false;
+ }
+ }
}
return $result;
@@ -240,49 +245,6 @@ class dbal_mssql_odbc extends dbal
}
/**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- if ($query_id === false)
- {
- return false;
- }
-
- $this->sql_freeresult($query_id);
- $query_id = $this->sql_query($this->last_query_text);
-
- if ($query_id === false)
- {
- return false;
- }
-
- // We do not fetch the row for rownum == 0 because then the next resultset would be the second row
- for ($i = 0; $i < $rownum; $i++)
- {
- if (!$this->sql_fetchrow($query_id))
- {
- return false;
- }
- }
-
- return true;
- }
-
- /**
* Get last inserted id after insert statement
*/
function sql_nextid()