当前位置: 首页 > news >正文

表 ,索引的 degree 检查, trim(degree) default INSTANCES

检查degree >1 的

select substr(owner,1,15) Owner , ltrim(degree) Degree,
ltrim(instances) Instances,
count(*) "Num Tables" , 'Parallel'
from dba_tables
where ( trim(degree) > '1'   )   
and table_name not like 'ET$%'
group by owner, degree , instances 
order by owner;

--select *from dba_tables where ( trim(degree) > '1'   )   


 
select substr(owner,1,15) Owner ,
substr(trim(degree),1,7) Degree ,
substr(trim(instances),1,9) Instances ,
count(*) "Num Indexes",
'Parallel'
from dba_indexes
where ( trim(degree) > '1'   ) or
( trim(instances) != '1' and trim(instances) != '0' )
group by owner, degree , instances 
order by owner;

 
--select *  from dba_indexes where ( trim(degree) > '1'   ) or ( trim(instances) != '1' and trim(instances) != '0' )
alter index  xxx noparallel  change default to 1

----------------- degree default

For index maintenance (online rebuild). The session level degree of parallelism was altered to a higher value.

Alter session force parallel DDL parallel 12;

Alter session force parallel Query parallel 12;

Alter session force parallel DML parallel 12;

ALTER INDEX index_name rebuild ONLINE;

QUESTION : After the above maintenance, the index DOP is reflecting 12 instead of the default.

Is this an expected behavior ?

CHANGES

CAUSE

 This is expected behavior.

SOLUTION

FORCE Clause

FORCE forces parallel execution of subsequent statements in the session. If no parallel clause or hint is specified, then a default degree of parallelism is used. This clause overrides any parallel_clause specified in subsequent statements in the session but is overridden by a parallel hint.

DML: Provided no parallel DML restrictions are violated, subsequent DML statements in the session are executed with the default degree of parallelism, unless a degree is specified in this clause.

DDL: Subsequent DDL statements in the session are executed with the default degree of parallelism, unless a degree is specified in this clause. Resulting database objects will have associated with them the prevailing degree of parallelism. >>>>>>>>>>>>>>

Specifying FORCE DDL automatically causes all tables created in this session to be created with a default level of parallelism. The effect is the same as if you had specified the parallel_clause (with the default degree) in the CREATE TABLE statement.

QUERY: Subsequent queries are executed with the default degree of parallelism, unless a degree is specified in this clause.

--------------------

This article has been written to explain the formula to compute the new default value for the Database parameter  PARALLEL_MAX_SERVERS in 11.2.0.2 and above.

DETAILS

With 11.2.0.2 & above, there is a new method to compute the default for PARALLEL_MAX_SERVERS.


In the Oracle Rdbms Reference Guide we find:

parallel_max_servers = PARALLEL_THREADS_PER_CPU * CPU_COUNT * concurrent_parallel_users * 5

In the formula, the value assigned to concurrent_parallel_users running at the default degree of parallelism on an 

instance is dependent on the memory management setting. 

 - If automatic memory management is disabled (manual mode), then the value of concurrent_parallel_users is 1. 

 - If PGA automatic memory management is enabled, then the value of concurrent_parallel_users is 2. 

 - If global memory management or SGA memory target is used in addition to PGA automatic memory management, 

   then the value of concurrent_parallel_users is 4.

The value is capped by processes -15 (this is true for versions prior 11.2.0.2 as well).

As example we have the following values

parallel_threads_per_cpu  = 2
cpu_count                 = 4
pga_aggregate_target      = 500M
sga_target                = 900M
processes                 = 150

parallel_max_servers = 2 * 4 * 4 * 5 = 160
parallel_max_servers = min( 150-15 , 160 ) = 135

So with these values we get a default of 135 for parallel_max_servers.

Note if the parallel_max_servers is reduced due to value of processes, then you see similar to the following in alert log (e.g. at instance start up):

Mon May 06 18:43:06 2013
Adjusting the default value of parameter parallel_max_servers
from 160 to 135 due to the value of parameter processes (150)
Starting ORACLE instance (normal)

------check degree

Provide script for a DBA to check the degree of parallelism on tables and indexes.

SOLUTION

Requirements

Any tool that can execute SQL in the database. A simple one is SQLPlus.

Configuring

No configuration needed, other than remove the column formatting lines if not executed in SQLPlus.

Instructions

The scripts can be run with copy and paste after connected to the database as a user who has select access on the queried objects.

Script 

Check Script
-------------
col name format a30
col value format a20
Rem How many CPU does the system have?
Rem Default degree of parallelism is
Rem Default = parallel_threads_per_cpu * cpu_count
Rem -------------------------------------------------;
select substr(name,1,30) Name , substr(value,1,5) Value
from v$parameter
where name in ('parallel_threads_per_cpu' , 'cpu_count' );

col owner format a30
col degree format a10
col instances format a10
Rem Normally DOP := degree * Instances
Rem See the following Note for the exact formula.
Rem Note:260845.1 Old and new Syntax for setting Degree of Parallelism
Rem How many tables a user have with different DOPs
Rem -------------------------------------------------------;
select * from (
select substr(owner,1,15) Owner , ltrim(degree) Degree,
ltrim(instances) Instances,
count(*) "Num Tables" , 'Parallel'
from all_tables
where ( trim(degree) != '1' and trim(degree) != '0' ) or
( trim(instances) != '1' and trim(instances) != '0' )
group by owner, degree , instances
union
select substr(owner,1,15) owner , '1' , '1' ,
count(*) , 'Serial'
from all_tables
where ( trim(degree) = '1' or trim(degree) = '0' ) and
( trim(instances) = '1' or trim(instances) = '0' )
group by owner
)
order by owner;


Rem How many indexes a user have with different DOPs
Rem ---------------------------------------------------;
select * from (
select substr(owner,1,15) Owner ,
substr(trim(degree),1,7) Degree ,
substr(trim(instances),1,9) Instances ,
count(*) "Num Indexes",
'Parallel'
from all_indexes
where ( trim(degree) != '1' and trim(degree) != '0' ) or
( trim(instances) != '1' and trim(instances) != '0' )
group by owner, degree , instances
union
select substr(owner,1,15) owner , '1' , '1' ,
count(*) , 'Serial'
from all_indexes
where ( trim(degree) = '1' or trim(degree) = '0' ) and
( trim(instances) = '1' or trim(instances) = '0' )
group by owner
)
order by owner;


col table_name format a35
col index_name format a35
Rem Tables that have Indexes with not the same DOP
Rem !!!!! This command can take some time to execute !!!
Rem ---------------------------------------------------;
set lines 150
select substr(t.owner,1,15) Owner ,
t.table_name ,
substr(trim(t.degree),1,7) Degree ,
substr(trim(t.instances),1,9) Instances,
i.index_name ,
substr(trim(i.degree),1,7) Degree ,
substr(trim(i.instances),1,9) Instances
from all_indexes i,
all_tables t
where ( trim(i.degree) != trim(t.degree) or
trim(i.instances) != trim(t.instances) ) and
i.owner = t.owner and
i.table_name = t.table_name;

Sample Output

NAME VALUE
------------------------------ --------------------
cpu_count 2
parallel_threads_per_cpu 2

OWNER DEGREE INSTANCES Num Tables 'PARALLEL'
------------------------------ ---------- ---------- ---------- ------------
APEX_030200 1 1 360 Serial
APEX_040000 1 1 426 Serial
APEX_WS1 1 1 18 Serial
APPQOSSYS 1 1 4 Serial
CTXSYS 1 1 49 Serial
DWHBW 8 1 1 Parallel
DWH_DM DEFAULT DEFAULT 1 Parallel
... OWNER DEGREE INSTANCES Num Indexes 'PARALLEL'
------------------------------ ---------- ---------- ----------- -----------
APEX_030200 1 1 946 Serial
APEX_040000 1 1 1177 Serial
APEX_WS1 1 1 28 Serial
CTXSYS 1 1 59 Serial
DWHBW 1 1 20 Serial
DWH_DM DEFAULT DEFAULT 1 Parallel ... OWNER TABLE_NAME DEGREE INSTANCES INDEX_NAME DEGREE INSTANCES
------------------------------ ----------------------------------- ---------- ---------- ----------------------------------- ---------- ----------
OWBSYS CMPFCOCLASSES 1 1 IDX_FCOUOID DEFAULT DEFAULT
OWBSYS CMPFCOCLASSES 1 1 IDX_FCOCLASSNAMEELEMID DEFAULT DEFAULT
OWBSYS CMPFCOCLASSES 1 1 IDX_FCOOWNINGFOLDER DEFAULT DEFAULT
OWBSYS CMPFCOCLASSES 1 1 IDX_FCONAME DEFAULT DEFAULT 

------------------instance default-------------

This notes explain the differences for setting of the  DOP ( Degree of Parallelism )
on a object between old and new syntax.

SCOPE

 DBA's , Developer's and Engineers.

DETAILS

Before 8.1 we used the syntax

parallel(object, degree, instances)

to define the degree of parallelism. In 8.1 we changed the syntax to

parallel(object, degree )

There was a documentation bug until 10g that the documentation
only used the old syntax.
For the backward compatibilty we convert internally the old into the
next syntax.

When we use the old syntax, a value for instances, does not mean that
we restrict slaves only on this instances.


1.) DOP's on Tables and Indexes
--------------------------------

We use the Matrix above to convert table /index setting's into the next syntax:

    Degree          Instances         new Oracle DOP
   ---------        ---------        ------------------
      1                1                    1
      x             Default                 x
      x                1                    x
      1             Default              Default
   Default             y                    y
      1                y                    y
   Default             1                 Default
      x                y                   x*y
   Default          Default              Default


Example:

 create table test ...   parallel (degree 2 instances 3);

 is the same as

 create table test ...   parallel 6;



2.) DOP's setting via Hints

=======都强制了ALTER SESSION 还是并行,这个instance defalut的值是什么呢???

GOAL

What is the reason for which a statement is executed in parallel even so all the conditions of having this in serial are met?

The degree for all the tables involved is set to 1

and

parallel_degree_limit      CPU         
parallel_degree_policy     MANUAL

Much more even when setting:

ALTER SESSION DISABLE PARALLEL DML;
ALTER SESSION DISABLE PARALLEL DDL;
ALTER SESSION DISABLE PARALLEL QUERY;


the statement is still executed in parallel.
 

SOLUTION

Parallelism was triggered by the fact that instances was set to default for one of the tables even if the degree was set to 1.

SQL> select owner, table_name, degree, instances from dba_tables where table_name='LMCMPHQ';

OWNER       TABLE_NAME      DEGREE INSTANCES
------------------------------ ------------------------------ ---------- ----------------------------------------
TEST           LMTEST                 1    DEFAULT

This is  expected behaviour as explained into "Old and New Syntax for Setting Degree of Parallelism (Doc ID 260845.1)" when degree is 1 and instances is DEFAULT then the DOP is DEFAULT.

-------------------------

Query executes with DEFAULT PX sessions  when Degree=1 on object and no parallel hint is present
 

CAUSE

When a query shows parallel execution plan even if degree=1 and no hint used, check the value of "INSTANCES" from DBA_TABLES or DBA_INDEXES. A value of DEFAULT for INSTANCES will make the query use DEFAULT degree

e.g.

SQL> create table table_objects as select * from dba_objects union select * from dba_objects union select * from dba_objects union select * from dba_objects union select * from dba_objects union select * from dba_objects union select * from dba_objects;Table created.
SQL> create index table_objects_idx on TABLE_OBJECTS(OBJECT_TYPE,object_name) parallel(DEGREE 1 INSTANCES DEFAULT);Index created.SQL> explain plan for select /*+ index_ffs(table_objects,table_objects_idx) */ count(distinct object_name) from table_objects where OBJECT_TYPE='TABLE';Explained.SQL> select * from table(dbms_xplan.display) ;PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 2868850136---------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name              | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
---------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |                   |     1 |    66 |   175   (6)| 00:00:01 |        |      |            |
|   1 |  SORT AGGREGATE                |                   |     1 |    66 |            |          |        |      |            |
|   2 |   PX COORDINATOR               |                   |       |       |            |          |        |      |            |
|   3 |    PX SEND QC (RANDOM)         | :TQ10001          |     1 |    66 |            |          |  Q1,01 | P->S | QC (RAND)  |
|   4 |     SORT AGGREGATE             |                   |     1 |    66 |            |          |  Q1,01 | PCWP |            |
|   5 |      VIEW                      | VW_DAG_0          |  2387 |   153K|   175   (6)| 00:00:01 |  Q1,01 | PCWP |            |
|   6 |       HASH GROUP BY            |                   |  2387 |   184K|   175   (6)| 00:00:01 |  Q1,01 | PCWP |            |
|   7 |        PX RECEIVE              |                   |  2387 |   184K|   175   (6)| 00:00:01 |  Q1,01 | PCWP |            |
|   8 |         PX SEND HASH           | :TQ10000          |  2387 |   184K|   175   (6)| 00:00:01 |  Q1,00 | P->P | HASH       |
|   9 |          HASH GROUP BY         |                   |  2387 |   184K|   175   (6)| 00:00:01 |  Q1,00 | PCWP |            |
|  10 |           PX BLOCK ITERATOR    |                   |  2387 |   184K|   166   (0)| 00:00:01 |  Q1,00 | PCWC |            |
|* 11 |            INDEX FAST FULL SCAN| TABLE_OBJECTS_IDX |  2387 |   184K|   166   (0)| 00:00:01 |  Q1,00 | PCWP |            |
---------------------------------------------------------------------------------------------------------------------------------Predicate Information (identified by operation id):
---------------------------------------------------11 - filter("OBJECT_TYPE"='TABLE')
 
SQL> select index_name,degree,instances from dba_indexes where index_name='TABLE_OBJECTS_IDX';INDEX_NAME                     DEGREE                                   INSTANCES
------------------------------ ---------------------------------------- ----------------------------------------
TABLE_OBJECTS_IDX              1                                        DEFAULTSQL> alter index table_objects_idx noparallel;Index altered.SQL> select index_name,degree,instances from dba_indexes where index_name='TABLE_OBJECTS_IDX';INDEX_NAME                     DEGREE                                   INSTANCES
------------------------------ ---------------------------------------- ----------------------------------------
TABLE_OBJECTS_IDX              1                                        1SQL> explain plan for select /*+ index_ffs(table_objects,table_objects_idx) */ count(distinct object_name) from table_objects where OBJECT_TYPE='TABLE';Explained.SQL> select * from table(dbms_xplan.display) ;PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1073692753---------------------------------------------------------------------------------------------
| Id  | Operation               | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |                   |     1 |    66 |   168   (2)| 00:00:01 |
|   1 |  SORT AGGREGATE         |                   |     1 |    66 |            |          |
|   2 |   VIEW                  | VW_DAG_0          |  2387 |   153K|   168   (2)| 00:00:01 |
|   3 |    HASH GROUP BY        |                   |  2387 |   184K|   168   (2)| 00:00:01 |
|*  4 |     INDEX FAST FULL SCAN| TABLE_OBJECTS_IDX |  2387 |   184K|   166   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------Predicate Information (identified by operation id):
---------------------------------------------------4 - filter("OBJECT_TYPE"='TABLE')

As observed making the object to NoParallel makes the INSTANCES value to 1 or just to make INSTANCES=1 you can issue : alter index table_objects_idx PARALLEL(INSTANCES 1) ;

SOLUTION

When an object is created with PARALLEL and have INSTANCES=DEFAULT, it will make query to spawn DEFAULT degree. From 11gR2 onwards it is recommended not to use INSTANCES variable in PARALLEL clause

相关文章:

表 ,索引的 degree 检查, trim(degree) default INSTANCES

检查degree >1 的 select substr(owner,1,15) Owner , ltrim(degree) Degree, ltrim(instances) Instances, count(*) "Num Tables" , Parallel from dba_tables where ( trim(degree) > 1 ) and table_name not like ET$% group by owner, degree , ins…...

Git - Rebase命令介绍

Git rebase 是版本控制系统 Git 中一个功能强大、使用广泛的命令。它用于将一个分支中的改动整合到另一个分支中。rebase与merge不同, merge会创建一个新的提交,而rebase则是将一系列提交移动或合并到一个新的基础提交中。下面是详细解释: G…...

JavaScript 从入门到精通Object(对象)

文章目录 对象文本和属性方括号计算属性 属性值简写属性名称限制属性存在性测试,“in” 操作符“for…in” 循环像对象一样排序 总结✅任务你好,对象检查空对象对象属性求和将数值属性值都乘以 2 对象引用和复制通过引用来比较克隆与合并,Obj…...

Postgresql中json和jsonb类型区别

在我们的业务开发中,可能会因为特殊【历史,偷懒,防止表连接】经常会有JSON或者JSONArray类的数据存储到某列中,这个时候再PG数据库中有两种数据格式可以直接一对多或者一对一的映射对象。所以我们也可能会经常用到这类格式数据&am…...

太强了,使用 C# 开发的开源内网穿透工具

🏆作者:科技、互联网行业优质创作者 🏆专注领域:.Net技术、软件架构、人工智能、数字化转型、DeveloperSharp、微服务、工业互联网、智能制造 🏆欢迎关注我(Net数字智慧化基地),里面…...

leetcode及牛客网二叉树相关题、单值二叉树、相同的树、二叉树的前序、中序、后序遍历、另一棵树的子树、二叉树的遍历、 对称二叉树等的介绍

文章目录 前言一、单值二叉树二、相同的树三、二叉树的前序遍历四、二叉树的中序遍历五、二叉树的后序遍历六、另一棵树的子树七、二叉树的遍历八、 对称二叉树总结 前言 leetcode及牛客网二叉树相关题、单值二叉树、相同的树、二叉树的前序、中序、后序遍历、另一棵树的子树、…...

Spring (38)Spring Cloud

Spring Cloud是一系列框架的集合,它利用Spring Boot的开发便利性,简化了分布式系统(如配置管理、服务发现、断路器、路由、微代理、事件总线、全局锁、决策竞选、分布式会话等)的开发。Spring Cloud为开发人员提供了在分布式系统中…...

MySQL之数据库相关操作学习笔记(一)

数据库相关操作 数据库表创建 定义逻辑库、数据表 DML 添加修改删除查询 DCL 用户权限事务 DDL 逻辑库数据表视图索引 DCL (Data Control Language) 示例 DCL(数据控制语言)主要用于控制数据库用户的访问权限和管理事务。DCL 主要包含两类语句&…...

【Node】node的Events模块(事件模块)的介绍和使用

文章目录 简言EventsPassing arguments and this to listeners 向监听器传递参数Asynchronous vs. synchronous 异步和同步Handling events only once 只一次处理事件Error events 错误事件Capture rejections of promises 捕捉拒绝承诺的情况Class: EventEmitter 事件类Event:…...

C#中字节数组(byte[])末尾继续添加字节的示例

方法一:使用List 使用List可以很容易地在末尾添加字节,然后如果需要,可以将其转换回byte[]。 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Lin…...

Socket编程学习笔记之TCP与UDP

Socket: Socket是什么呢? 是一套用于不同主机间通讯的API,是应用层与TCP/IP协议族通信的中间软件抽象层。 是一组接口。在设计模式中,Socket其实就是一个门面模式,它把复杂的TCP/IP协议族隐藏在Socket接口后面&#…...

JavaScript第九讲BOM编程的练习题

前言 上一节有BOM的讲解,有需要的码客们可以去看一下 以下是一个结合了上述BOM(Browser Object Model)相关内容的练习题及其源代码示例: 练习题: 编写一个JavaScript脚本,该脚本应该执行以下操作&#…...

JavaScript 中创建函数的多种方式

在 JavaScript 中,可以通过多种方式创建函数。每种方式都有其特定的用途、优点和缺点,以及适用的使用场景。以下是几种常见的创建函数的方式及其详细说明。 1. 函数声明(Function Declaration) 示例 function add(a, b) {retur…...

对称二叉树[简单]

优质博文:IT-BLOG-CN 一、题目 给你一个二叉树的根节点root, 检查它是否轴对称。 示例 1: 输入:root [1,2,2,3,4,4,3] 输出:true 示例 2: 输入:root [1,2,2,null,3,null,3] 输出&#xf…...

判断GIF类型并使用ImageDecoder解析GIF图

一、判断是否为GIF图片类型 在JavaScript中,判断用户上传的文件是否为GIF文件类型时,通常可以通过检查文件的type属性或文件的拓展名来判断,但是由于文件拓展名可以轻易被用户修改,type属性是由浏览器根据文件拓展名猜测得出的&a…...

数组对象数据修改后页面没有更新,无法进行编辑,校验失效问题

在 Vue 中,当你通过 Object.assign 或其他方式修改了对象中的某个属性时,Vue 并不会触发组件重新渲染,因此表单中的 input 框无法及时更新。这可能导致在修改表单数据后,页面没有更新,而且表单校验也失效的情况。这是因…...

什么是低代码?有什么特点?

低代码是一种高效的软件开发方法,它允许开发者通过图形化界面和预构建的代码块,以最小化传统手写代码的方式快速构建应用程序。这种方法旨在加速应用程序的开发周期,同时降低技术门槛和成本。以下是根据驰骋低代码设计者的观念与主张&#xf…...

Kafka 消息保留时长由 24 小时变更为 72 小时的影响分析

目录 Kafka 消息保留时长由 24 小时变更为 72 小时的影响分析Kafka 消息存储机制保留时长对生产速度的影响保留时长对消费速度的影响底层分析与优化建议附加:将 Kafka 消息保留时长从 24 小时更改为 72 小时后,CPU 使用率从 40% 上升到 70% 的现象1. 增加…...

MySQL A表的字段值更新为B表的字段值

MySQL A表的字段值更新为B表的字段值 准备数据表 create table person (id int unsigned auto_increment comment 主键 primary key,uuid varchar(32) not null comment 系统唯一标识符32个长度的字符串,mobile varchar(11) null comment 中国国内手机号,nickn…...

TCP 建链(三次握手)和断链(四次握手)

TCP 建链(三次握手)和断链(四次挥手) 背景简介建链(三次握手)断链(四次挥手)序号及标志位延伸问题为什么建立连接需要握手三次,两次行不行?三次握手可以携带数…...

Python爬虫实战:研究MechanicalSoup库相关技术

一、MechanicalSoup 库概述 1.1 库简介 MechanicalSoup 是一个 Python 库,专为自动化交互网站而设计。它结合了 requests 的 HTTP 请求能力和 BeautifulSoup 的 HTML 解析能力,提供了直观的 API,让我们可以像人类用户一样浏览网页、填写表单和提交请求。 1.2 主要功能特点…...

23-Oracle 23 ai 区块链表(Blockchain Table)

小伙伴有没有在金融强合规的领域中遇见,必须要保持数据不可变,管理员都无法修改和留痕的要求。比如医疗的电子病历中,影像检查检验结果不可篡改行的,药品追溯过程中数据只可插入无法删除的特性需求;登录日志、修改日志…...

多种风格导航菜单 HTML 实现(附源码)

下面我将为您展示 6 种不同风格的导航菜单实现&#xff0c;每种都包含完整 HTML、CSS 和 JavaScript 代码。 1. 简约水平导航栏 <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><meta name"viewport&qu…...

爬虫基础学习day2

# 爬虫设计领域 工商&#xff1a;企查查、天眼查短视频&#xff1a;抖音、快手、西瓜 ---> 飞瓜电商&#xff1a;京东、淘宝、聚美优品、亚马逊 ---> 分析店铺经营决策标题、排名航空&#xff1a;抓取所有航空公司价格 ---> 去哪儿自媒体&#xff1a;采集自媒体数据进…...

大语言模型(LLM)中的KV缓存压缩与动态稀疏注意力机制设计

随着大语言模型&#xff08;LLM&#xff09;参数规模的增长&#xff0c;推理阶段的内存占用和计算复杂度成为核心挑战。传统注意力机制的计算复杂度随序列长度呈二次方增长&#xff0c;而KV缓存的内存消耗可能高达数十GB&#xff08;例如Llama2-7B处理100K token时需50GB内存&a…...

Python Ovito统计金刚石结构数量

大家好,我是小马老师。 本文介绍python ovito方法统计金刚石结构的方法。 Ovito Identify diamond structure命令可以识别和统计金刚石结构,但是无法直接输出结构的变化情况。 本文使用python调用ovito包的方法,可以持续统计各步的金刚石结构,具体代码如下: from ovito…...

JavaScript基础-API 和 Web API

在学习JavaScript的过程中&#xff0c;理解API&#xff08;应用程序接口&#xff09;和Web API的概念及其应用是非常重要的。这些工具极大地扩展了JavaScript的功能&#xff0c;使得开发者能够创建出功能丰富、交互性强的Web应用程序。本文将深入探讨JavaScript中的API与Web AP…...

深度学习水论文:mamba+图像增强

&#x1f9c0;当前视觉领域对高效长序列建模需求激增&#xff0c;对Mamba图像增强这方向的研究自然也逐渐火热。原因在于其高效长程建模&#xff0c;以及动态计算优势&#xff0c;在图像质量提升和细节恢复方面有难以替代的作用。 &#x1f9c0;因此短时间内&#xff0c;就有不…...

如何更改默认 Crontab 编辑器 ?

在 Linux 领域中&#xff0c;crontab 是您可能经常遇到的一个术语。这个实用程序在类 unix 操作系统上可用&#xff0c;用于调度在预定义时间和间隔自动执行的任务。这对管理员和高级用户非常有益&#xff0c;允许他们自动执行各种系统任务。 编辑 Crontab 文件通常使用文本编…...

C#学习第29天:表达式树(Expression Trees)

目录 什么是表达式树&#xff1f; 核心概念 1.表达式树的构建 2. 表达式树与Lambda表达式 3.解析和访问表达式树 4.动态条件查询 表达式树的优势 1.动态构建查询 2.LINQ 提供程序支持&#xff1a; 3.性能优化 4.元数据处理 5.代码转换和重写 适用场景 代码复杂性…...