|
esileDec 6, 2023 via Android
1
这是怎么实现的🤣
|
|
MossFoxDec 6, 2023
3
真的吗,看看源程序。
这么大的数字第一时间为什么只会觉得是 Cloudflare 的问题 |
|
NessajCNDec 6, 2023
4
是不是用了 useEffect()之类的 hook
|
|
5
@MossFox 它可能是 io 一次就算一次请求了
``` async function handleGetTrendsRequest(request, env) { try { const data = await env.DATABASE.prepare("SELECT * FROM google_trend WHERE date = ?") .bind(date) .all(); return createCORSResponse(JSON.stringify(data)); } catch (error) { return new Response(error.message, { status: 500 }); } } ``` |
|
oldshensheepDec 6, 2023
8
date 有没有加索引?没有加索引的话会全表扫描。Cloudflare 计算的是扫描到的行数作为请求量的
|
|
metrueDec 6, 2023
9
你这个“30 多个”指的是 RPS, 你说的 "22W 个" 是 Total 吧,所以别让大家用的原因是什么呢?
|
|
10
@NessajCN 上面那个统计是 worker 接收到的统计, 实际请求量应该就是 30 多个左右吧
@oldshensheep 是的,应该 io 一次就算一个请求了,还没有找到加 index 的位置,先下线吧😭 |
|
oldshensheepDec 6, 2023
12
加索引不是写个 SQL 就行了嘛
|
|
RheinmetalDec 6, 2023
13
Rows read measure how many rows a query reads (scans), regardless of the size of each row. For example, if you have a table with 5000 rows and run a SELECT * FROM table as a full table scan, this would count as 5,000 rows read. A query that filters on an unindexed column may return fewer rows to your Worker, but is still required to read (scan) more rows to determine which subset to return.
是不是频繁全表扫描的问题? |