aci_set_prefetch_lob¶
aci_set_prefetch_lob—设置为每个CLOB或BLOB预取的数据量。
说明¶
aci_set_prefetch_lob(resource $statement, int $prefetch_lob_size): bool
设置在成功查询调用 aci_execute() 之后,当实现从数据库中获取内部数据库 LOB定位器时,以及对于数据库的每个后续内部获取请求,用于获取每个CLOB或BLOB值的内部缓冲区大小。增加该值可以通过减少PHP和数据库之间的往返来提高获取较小LOB的性能。内存使用情况将发生变化。
该值影响作为OCILob实例返回的LOB以及使用aci_RETURN_LOBs返回的LOBs。
在调用 aci_execute() 之前,先调用aci_set_prefetch_lob()。如果未调用,则使用aci8.prefetch_lob_size的值。
参数¶
有效的 ACI8 报表标识符 由 aci_parse() 创建,被 aci_execute() 或 REF CURSOR statement 标识执行。
The number of bytes of each LOB to be prefetched, >= 0
返回值¶
成功时返回 true, 或者在失败时返回 false。
范例¶
示例 #1 Changing the LOB prefetch value for a query
<?php
$conn = aci_connect('SYSDBA', 'szoscar55', 'localhost:2003/OSRDB');
$stid = aci_parse($conn, 'SELECT myclob FROM mytable');
aci_set_prefetch_lob($stid, 100000); // Set before calling aci_execute()
aci_execute($stid);
echo "<table border='1'>\n";
while ($row = aci_fetch_array($stid, aci_ASSOC+aci_RETURN_NULLS+aci_RETURN_LOBS)) {
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : " ")."</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
aci_free_statement($stid);
aci_close($conn);
?>
参见¶
aci8.prefetch_lob_size ini选项