《Redis使用手册》(试读版)
命令从 Redis 1.0.0 版本开始可⽤。 11.3 SCAN:以渐进⽅式迭代数据库中的键 因为 KEYS 命令需要检查数据库包含的所有键, 并⼀次性将符合条件的所有键全部返回给客户端, 所以当数据库 包含的键数量⽐较⼤时, 使⽤ KEYS 命令可能会导致服务器被阻塞。 为了解决这个问题, Redis 从 2.8.0 版本开始提供 SCAN 命令, 该命令是⼀个迭代器, 它每次被调⽤的时候都会 它每次被调⽤的时候都会 从数据库⾥⾯获取⼀部分键, ⽤户可以通过重复调⽤ SCAN 命令来迭代数据库包含的所有键: SCAN cursor SCAN 命令的 cursor 参数⽤于指定迭代时使⽤的游标, 游标记录了迭代进⾏的轨迹和进度。 在开始⼀次新的迭代 时, ⽤户需要将游标设置为 0 : SCAN 0 SCAN 命令的执⾏结果由两个元素组成: 第⼀个元素是进⾏下⼀次迭代所需的游标, 如果这个游标为 0 , 第⼆个元素是⼀个列表, 这个列表包含了本次迭代取得的数据库键; 如果 SCAN 命令在某次迭代中没有获取 到任何键, 那么这个元素将是⼀个空列表。 关于 SCAN 命令返回的键列表, 有两个需要注意的地⽅: 1. SCAN 命令可能会返回重复的键, ⽤户如果不想在结果⾥⾯包含重复的键, 那么就需要⾃⼰在客户端⾥⾯进 ⾏检测和过滤。 2. SCAN 命令返回的键数量是不确定的, 有时候甚⾄会不返回任何键,0 码力 | 352 页 | 6.57 MB | 1 年前3⽤ egg 孵化你的 SQL 优化器 - 王润基
url Filter t1.id = t2.id name = “Bob” Join Scan t1(id, name) Scan t2(id, url) Filter #1 = “Bob” Hash Join #0 = #2 Scan $1.1, $1.2 Scan $2.1, $2.2 Projection #1, #3 ⼀个 SQL 语句优化的例⼦ (and (= $1.1 $2.1) (= $1.2 “Bob”)) (join inner true (scan $1 (list $1.1 $1.2)) (scan $2 (list $2.1 $2.2)) ))) 定义语⾔ 构造表达式 2 + x y + * 定义规则:表达式化简 定义规则:算⼦化简 Join (join inner true (scan $1 (list $1.1 $1.2)) (scan $2 (list $2.1 $2.2)) )) (join inner (= $1.1 $2.1) (filter (= $1.2 “Bob”) (scan $1 (list $1.1 $1.2))) (scan $2 (list $2.1 $2.2))0 码力 | 39 页 | 6.48 MB | 1 年前3大学霸 Kali Linux 安全渗透教程
restrict the hosts that admin has the right to test. For instance, you may want him to be able to scan his own host only. Please see the nessus-adduser manual for the rules syntax Enter the rules for 61.135.166.0-255 : 1 hostnames found. 61.135.185.0-255 : 1 hostnames found. Done with Fierce scan: http://ha.ckers.org/fierce/ Found 133 entries. Have a nice day. 大学霸 Kali Linux 安全渗透教程 112 4.1 枚举服务 root@kali:~# nmap -sP 192.168.41.136 Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 17:54 CST Nmap scan report for www.benet.com (192.168.41.136) Host is up (0.00028s latency). MAC Address: 00:0C:29:31:02:170 码力 | 444 页 | 25.79 MB | 1 年前3Scaling with PostgreSQL 9.6 and Postgres-XL
Append (cost=0.00..347.89 rows=39 width=31) -> Seq Scan on invoice Filter: (invoice_id = 1) -> Foreign Scan on invoice_ch -> Foreign Scan on invoice_us pg pg_ch pg_us Postgres Conference China Append (cost=0.00..347.89 rows=39 width=31) -> Seq Scan on invoice Filter: (invoice_id = 1) -> Foreign Scan on invoice_ch -> Foreign Scan on invoice_us EXPLAIN SELECT * FROM invoice WHERE invoice_id 'CH'; Append (cost=0.00..265.21 rows=2 width=22) -> Seq Scan on invoice Filter: ((invoice_id = 1) AND (country = 'CH'::bpchar)) -> Foreign Scan on invoice_ch pg pg_ch pg_us Avoids using invoice_us0 码力 | 87 页 | 1.16 MB | 1 年前3Greenplum介绍
width=0) -> Aggregate (cost=13884.40..13884.41 rows=1 width=0) -> Seq Scan on t1 (cost=0.00..11377.12 rows=250728 width=0) tangdb=# explain select id,count(*) from t1 HashAggregate (cost=16391.68..28928.08 rows=250728 width=4) Group By: id -> Seq Scan on t1 (cost=0.00..11377.12 rows=250728 width=4) GP的执行计划 tangdb=# explain select name,count(*) 16391.68 rows=250728 width=6) Group By: t1.name -> Seq Scan on t1 (cost=0.00..11377.12 rows=250728 width=6) 如果在单机上的执行计划: osdba=# explain select name,count(*)0 码力 | 38 页 | 655.38 KB | 1 年前3PostgreSQL 查询优化器解析
Preprocessing ØSimplify the query if possible; collect information • Scan/join planning ØDecide how to implement FROM/WHERE • Post scan/join planning ØDeal with plan steps that are not scans or joins OpenPie. All rights reserved. OpenPie Confidential • A qual clause can be enforced at the lowest scan or join level that includes all relations used in the clause. • Outer joins that may null some ----------------------------- Nested Loop Left Join Join Filter: (foo.a = 42) -> Seq Scan on foo -> Materialize -> Seq Scan on bar (5 rows) @2024 OpenPie. All rights reserved. OpenPie Confidential EXPLAIN0 码力 | 37 页 | 851.23 KB | 1 年前3Greenplum上云与优化
city Return Hash Scan 主机 Scan Hash MPP处理举例 2016Postgres中国用户大会 GP vs. RDS? Select count(*) from customer group by city Hash Scan 主机 Hash Scan Hash Scan 主机 Hash Scan MPP处理举例 2016Postgres中国用户大会 2016Postgres中国用户大会 GP vs. RDS? Select count(*) from customer group by city HashAgg Hash Scan 主机 Hash Scan Hash Scan 主机 Hash Scan MPP处理举例 2016Postgres中国用户大会 GP vs. RDS? Select count(*) from customer where0 码力 | 26 页 | 1.13 MB | 1 年前3云原生数据库PieCloudDB 性能优化之路
----------------------- ---- -- Nested Loop Left Join Join Filter: ( foo.a = 42) -> Seq Scan on foo -> Materialize -> Seq Scan on bar (5 rows) • 对于外连接上层的约束条件,如果它引用了nullable side的表,那么它就无法被下推到该外连接之 下 # EXPL ----- ---- - Nested Loop Left Join Filter: (COALESCE( bar.c, 1) = 42) -> Seq Scan on foo -> Materialize -> Seq Scan on bar (5 rows) • 主要处理查询语句中FROM和WHERE部分 • 同时也会考虑到ORDER BY的信息 • 代价驱动 • 为基表 Redistribute Motion 3:3 (slice2; segments: 3) Hash Key: a -> Partial HashAggregate Group Key: a -> Seq Scan on t # explain (costs off) select sum(distinct b) from t group by a; QUERY PLAN --------------0 码力 | 26 页 | 711.44 KB | 1 年前3Greenplum 分布式数据库内核揭秘
---------- Gather Motion 3:1 (slice1; segments: 3) Merge Key: t1 -> Sort Sort Key: t1 -> Seq Scan on t Optimizer: Postgres query optimizer (6 rows) Confidential │ ©2021 VMware, Inc. 20 Redistribute = t.t1) -> Redistribute Motion 3:3 (slice1; segments: 3) Hash Key: s.s1 -> Seq Scan on s -> Hash -> Seq Scan on t Optimizer: Postgres query optimizer (9 rows) Confidential │ ©2021 VMware, Inc Left Anti Semi (Not-In) Join Hash Cond: (t.t1 = s.s1) -> Seq Scan on t -> Hash -> Broadcast Motion 3:3 (slice1; segments: 3) -> Seq Scan on s Optimizer: Postgres query optimizer (8 rows) Confidential0 码力 | 31 页 | 3.95 MB | 1 年前3TiDB v5.2 中文手册
文件的吞吐。正常时单个 TiKV 节点的吞吐 在 150MB/s 左右。 184 图 16: img One Backup Range Duration:备份一个 range 的操作耗时,包括扫描耗时 (scan KV) 和保存耗时(保存为 backupSST 文件)。 图 17: img One Backup Subtask Duration:一次备份任务会被拆分成多个子任务。该监控项显示子任务的耗时。 quota 缓存 在内 存中 的 TiCDC 数据 变更 事件 占用 内存 的上 限 cdc.incremental- scan- speed- limit 增量 扫描 历史 数据 的速 度上 限 238 配置 项 简介 cdc.incremental- scan- concurrency 增量 扫描 历史 数据 任务 的最 大并 发执 行个 数 上述前缀为 {db-name} 日志中查看慢查询日志,看查询是否用到了索引或全表扫,或者看是否需要做 analyze。 2. 排查是否有热点。 3. 查看 Coprocessor 监控,看 coporcessor table/index scan 里 total 和 process 是否匹配。如果相差 太大,表明做了太多的无效查询。看是否有 over seek bound,如果有,表明版本太多,GC 工作不 及时,需要增大并行 GC 的线程数。0 码力 | 2259 页 | 48.16 MB | 1 年前3
共 176 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18