A query to cache (or not), should take ~1 (or ~10) secs.
with hn_ids as (
select generate_series(1, 100) as id
),
hn_urls as (
select
'https://hacker-news.firebaseio.com/v0/item/' || h.id || '.json' as hn_api_url
from
hn_ids h
)
select
*
from
net_http_request n
where
n.url in ( select hn_api_url from hn_urls )
Run it twice.
.cache clear
<query>
Time: 10.7s. Rows fetched: 100. Hydrate calls: 0.
<query>
Time: 1.1s. Rows fetched: 100 (cached). Hydrate calls: 0.
Tweak the settings (in this case turn off the cache).
connection "net" {
plugin = "net"
options "connection" {
cache = false
#cache = true # true, false
# cache_ttl = 300 # expiration (TTL) in seconds
}
}
Run it twice.
Time: 9.7s. Rows fetched: 100. Hydrate calls: 0.
Time: 10.2s. Rows fetched: 100. Hydrate calls: 0