Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
ENH: refs #952. Cluster hashes table on each new write in pgsql
Browse files Browse the repository at this point in the history
This destroys the correspondence of row order to user table order
  • Loading branch information
zachmullen committed Feb 26, 2013
1 parent 37ce159 commit 0c7822a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/models/pdo/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ function storePasswordHash($hash)
if(!$this->hashExists($hash))
{
$this->database->getDB()->insert('password', array('hash' => $hash));

if(Zend_Registry::get('configDatabase')->database->adapter == 'PDO_PGSQL')
{
// Pgsql doesn't store rows sorted by their pkey so we must explicitly cluster them after each new write,
// otherwise the order of hashes would correspond to the order of users
$this->database->getDB()->query('CLUSTER password USING password_hash');
}
}
}

Expand Down

0 comments on commit 0c7822a

Please sign in to comment.