function shard_table($id) { if (empty($this->_table_before_shard)) { $this->_table_before_shard = $this->table; } $table_id = intval($id / $this->tablesize); $this->table = $this->_table_before_shard . '_' . $table_id; }