SQLite Overview |
|
2024-11-25 |
|
|
17 |
|
|
Like MySQL, SQLite supports unbuffered queries that can be used to more efficiently retrieve data.
<?php
function check_if_exists($cc)
{
$result = sqlite_unbuffered_query(
"SELECT id FROM country_data WHERE cc_code_2='{$cc}'",
sqlite_r
);
$data = sqlite_fetch_array($result, SQLITE_NUM);
return $data ? $data[0] : NULL;
}
?>
- • 15-30% performance increase depending on the number of rows fetched.
- • Data is available right away, don't need to wait for all data to be pre-fetched.
- • Lower memory utilization.
- • Can only move forward one row at a time.
- • Each row can only be accessed once.