reduce the data copy for vectorIndex search with content cached

This commit is contained in:
lion 2022-06-23 15:03:18 +08:00
parent 1f0d242582
commit a2b6eb6b8c
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ class XdbSearcher
if ($this->vectorIndex != null) {
$sPtr = self::getLong($this->vectorIndex, $idx);
$ePtr = self::getLong($this->vectorIndex, $idx + 4);
} else if ($this->contentBuff != null) {
$sPtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx);
$ePtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx + 4);
} else {
// read the vector index block
$buff = $this->read(self::HeaderInfoLength + $idx, 8);