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

MYSQL PARTITIONING分区操作和性能测试

PARTITION OR NOT PARTITION IN MYSQl

Bill Karwin says “In most circumstances, you’re better off using indexes instead of partitioning as your main method of query optimization.”
According to RICK JAMES: “It is so tempting to believe that PARTITIONing will solve performance problems. But it is so often wrong.”
let’s find out what’s going on by building a test case

TWO TABLES READY

How many partitions? views from Rick James: Have 20-50 partitions; no more.
In this page, we do 10 partitions
Remember: Always test your real case.

  1. Partition table with 10 partitions
CREATE TABLE points_partition 
(id INT NOT NULL AUTO_INCREMENT,x FLOAT,y FLOAT,z FLOAT,created_time DATETIME,PRIMARY KEY(id, created_time))
PARTITION BY RANGE( YEAR(created_time) ) (PARTITION p16 VALUES less than (2016),PARTITION p17 VALUES less than (2017),PARTITION p18 VALUES less than (2018),PARTITION p19 VALUES less than (2019),PARTITION p20 VALUES less than (2020),PARTITION p21 VALUES less than (2021),PARTITION p22 VALUES less than (2022),PARTITION p23 VALUES less than (2023),PARTITION p24 VALUES less than (2024),PARTITION p25 VALUES less than (2025)
) ;
  1. Normal table
CREATE TABLE points_full_table 
(id INT NOT NULL AUTO_INCREMENT,x FLOAT,y FLOAT,z FLOAT,created_time DATETIME,PRIMARY KEY(id, created_time));

Create millions of rows

For test case, each table holds 10 millions of rows
If using mysql to insert, example 2 is better than example 1

-- sql example 1
INSERT INTO `table1` (`field1`, `field2`) VALUES ("data1", "data2");
INSERT INTO `table1` (`field1`, `field2`) VALUES ("data1", "data2");
INSERT INTO `table1` (`field1`, `field2`) VALUES ("data1", "data2");
-- sql example 2
INSERT INTO `table1` (`field1`, `field2`) VALUES ("data1", "data2"),("data1", "data2"),("data1", "data2");

Add large data with tools

from faker import Faker
import randomdef insert_large_data(nums=10):fake = Faker()data = [(random.random(), random.random(), random.random(),str(fake.date_time_between(start_date='-10y', end_date='now'))) for i in range(nums)]cursor = connection.cursor()sql = f"INSERT INTO points_partition (x, y, z, created_time) VALUES (%s, %s, %s, %s)"# execute sql with your idea tool

DB-status

partition table take extra files to preserve data, also, extra disk space
请添加图片描述
partition table
请添加图片描述

TEST RESULTS WITHOUT EXTRA INDEX(created_time)

test-1
select SQL_NO_CACHE * from sample.points_partition where created_time > '2024-01-01' limit 100;

FROM: explain

idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_partitionp25ALL91162533.33Using where
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_full_tableALL974720733.33Using where

FROM:mysqlslap

# partition_table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 0.156 secondsMinimum number of seconds to run all queries: 0.156 secondsMaximum number of seconds to run all queries: 0.156 secondsNumber of clients running queries: 10Average number of queries per client: 10
# full_table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 0.172 secondsMinimum number of seconds to run all queries: 0.172 secondsMaximum number of seconds to run all queries: 0.172 secondsNumber of clients running queries: 10Average number of queries per client: 10

In general, it is expected that fewer touched rows would result in less time for query execution.
since this query only required limit rows under condition without order, mysql optimizer is doing a good job here.
the worse case for the full table is that do a full table scan, but to get just 100 target rows from random data, much less time is needed.

however, if we put a order by in where clause, things will be a huge different.

test-2
select SQL_NO_CACHE * from sample.points_partition where created_time > '2024-01-01' order by created_time limit 100;

FROM: explain

idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_partitionp25ALL91162533.33Using where; Using filesort
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_full_tableALL974720733.33Using where; Using filesort

FROM:mysqlslap

# partition table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 4.931 secondsMinimum number of seconds to run all queries: 4.931 secondsMaximum number of seconds to run all queries: 4.931 secondsNumber of clients running queries: 10Average number of queries per client: 10
# full table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 54.652 secondsMinimum number of seconds to run all queries: 54.652 secondsMaximum number of seconds to run all queries: 54.652 secondsNumber of clients running queries: 10Average number of queries per client: 10

A huge time gap between two queries.
what’ going on?
under condition of “order by”
a full table needs a full table-field sort, that’s cost a lot,
a partition table only need to sort a partition after located target partition.
we always say: test your real case, by this way, you find your circumstance to do a partition table.

WHY:In most circumstances, you’re better off using indexes instead of partitioning

the test are not done yet
From mysql explain, the extra field print a message: “Using filesort”
normally, you should considering a index here to improve performance: MYSQL: explain-extra-information

let’s add a index

ALTER TABLE `points_partition` ADD INDEX `created_time_index` (`created_time`);
ALTER TABLE `points_full_table` ADD INDEX `created_time_index` (`created_time`);

TEST RESULTS WITH INDEX

test-3
select SQL_NO_CACHE * from sample.points_partition where created_time > '2024-01-01' limit 100;

FROM: explain

idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_partitionp25rangecreated_time_indexcreated_time_index5455812100.00Using index condition
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_full_tablerangecreated_time_indexcreated_time_index52641784100.00Using index condition; Using MRR

FROM: mysqlslap

# partition table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 0.168 secondsMinimum number of seconds to run all queries: 0.168 secondsMaximum number of seconds to run all queries: 0.168 secondsNumber of clients running queries: 10Average number of queries per client: 10
# full table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 0.368 secondsMinimum number of seconds to run all queries: 0.368 secondsMaximum number of seconds to run all queries: 0.368 secondsNumber of clients running queries: 10Average number of queries per client: 10

again: In general, it is expected that fewer touched rows would result in less time for query execution.
new queries cost a little more time than without extra index.
what happens? explain shows “condition index” are being used here.
stop here, it’s not how indexes are introduced.
sometimes, index is not help if the goal was retrieve 100 target rows. the worst case, yes, but not all.

let’s put a “order by” to see the magic

test-4
select SQL_NO_CACHE * from sample.points_partition where created_time > '2024-01-01' order by created_time limit 100;

FROM: explain

idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_partitionp25rangecreated_time_indexcreated_time_index5455812100.00Using index condition
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLEpoints_full_tablerangecreated_time_indexcreated_time_index52641784100.00Using index condition

FROM: mysqlslap

# partition table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 0.162 secondsMinimum number of seconds to run all queries: 0.162 secondsMaximum number of seconds to run all queries: 0.162 secondsNumber of clients running queries: 10Average number of queries per client: 10
# full table
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 0.185 secondsMinimum number of seconds to run all queries: 0.185 secondsMaximum number of seconds to run all queries: 0.185 secondsNumber of clients running queries: 10Average number of queries per client: 10

same touched rows as no “order by”.
but the time cost of queries are getting really closed.
makes sense “In this circumstance, you’re better off using indexes instead of partitioning”.
after all, there are different types of queries were influenced and Maintenance of PARTITION is also a big thing.
For example: select count() is much slower for partition tables. unless doing a partition count()

more tests?
let’s stop here

table vs (better view)

key/typepartitionnormalpartition+ordernormal+orderpartition+indexnormal+indexpartition+order+indexnormal+order+index
diskspace~590m~540m~590m~540m~750m~700m~750m~700m
mysqlslap-benchmark0.156s0.172s4.931s54.652s0.168s0.368s0.162s0.185s
mysql-explain-touched-rows9116259747207911625974720745581226417844558122641784
index////created_time_indexcreated_time_indexcreated_time_indexcreated_time_index

POINTS BASED ON TEST(mysqlslap & mysql workbench)

  1. Index works good without partitioning, most of cases even better
  2. Under condition of range query by partition field, partitioning tables works good indeed
  3. drop partitions is much more efficient when doing a big delete
  4. if queries use specific partition, performance will better

Other Points Related & documents & Links:

  1. Partitioning mainly helps when your full table is larger than RAM
  2. No partitioning without million rows, Only BY RANGE provides any performance…
  3. index order(DESC or ASC) is also important
  4. mysqlslap–benchmark tool
  5. questions about partition

相关文章:

MYSQL PARTITIONING分区操作和性能测试

PARTITION OR NOT PARTITION IN MYSQl Bill Karwin says “In most circumstances, you’re better off using indexes instead of partitioning as your main method of query optimization.” According to RICK JAMES: “It is so tempting to believe that PARTITIONing wi…...

go引入skywalking

前置条件:安装好jdk11,linux服务器(centos7.9),go版本(我的是1.18,1.21都可以) 1.下载skywalking Downloads | Apache SkyWalking 2.下载agent源码 Downloads | Apache SkyWalkin…...

如何通过实构与虚构实现动态交互的态、势、感、知的编排组合

通过 实构 与 虚构 实现 动态人机交互的态、势、感、知 的编排组合,是一个涉及多领域的复杂任务。这个问题的核心在于如何将现实和虚拟世界中的元素,特别是人的 态 (状态)、 势 (趋势)、 感 (感…...

easyexcel 导出日期格式化

1.旧版本 在新的版本中formate已经被打上废弃标记。那么不推荐使用这种方式。 2.推荐方式 推荐使用另外一种方式【 Converter 】代码如下,例如需要格式化到毫秒【yyyy-MM-dd HH:mm:ss SSS】级别 创建一个公共Converter import com.alibaba.excel.converters.Conv…...

大模型Qwen面试内容整理-模型架构与原理

Qwen(通义千问)是阿里巴巴推出的大规模语言模型,其架构和原理与当前主流的大模型(如GPT、LLaMA等)有很多相似之处,但也具备一些独特的特点。下面是Qwen模型架构和原理的详细介绍: Transformer 架构 Qwen模型基于改进的 Transformer 架构,这是一种广泛用于自然语言处理(…...

Python 类的设计(以植物大战僵尸为例)

关于类的设计——以植物大战僵尸为例 一、设计类需满足的三要素1. 类名2. 属性和方法 二、以植物大战僵尸的为例的类的设计1. 尝试分类2. 创建对象调用类的属性和方法*【代码二】*3. 僵尸的继承 三、代码实现 一、设计类需满足的三要素 1. 类名 类名:某类事物的名…...

docker学习笔记(五)--docker-compose

文章目录 常用命令docker-compose是什么yml配置指令详解versionservicesimagebuildcommandportsvolumesdepends_on docker-compose.yml文件编写 常用命令 命令说明docker-compose up启动所有docker-compose服务,通常加上-d选项,让其运行在后台docker-co…...

第一个 JSP 程序

一个简单的 JSP 程序&#xff1a; 使用 IDEA 开发工具新建一个 maven 项目&#xff0c;具体操作如图所示&#xff1a; 配置 Tomcat 服务器 项目结构如下图所示&#xff1a; 3. 修改 index.jsp 页面的代码&#xff1a; <% page language"java" contentType&q…...

MongoDB分片集群搭建及扩容

分片集群搭建及扩容 整体架构 环境准备 3台Linux虚拟机&#xff0c;准备MongoDB环境&#xff0c;配置环境变量。一定要版本一致&#xff08;重点&#xff09;&#xff0c;当前使用 version4.4.9 配置域名解析 在3台虚拟机上执行以下命令&#xff0c;注意替换实际 IP 地址 e…...

Transformer简述和实现

Transformer 1、概述 (一)、诞生 自从2017年此文《Attention is All You Need》提出来Transformer后&#xff0c;便开启了大规模预训练的新时代&#xff0c;也在历史的长河中一举催生出了GPT、BERT这样的里程碑模型。 (二)、优势 相比之前占领市场的LSTM和GRU模型&#xf…...

使用Python3 连接操作 OceanBase数据库

注&#xff1a;使用Python3 连接 OceanBase数据库&#xff0c;可通过安装 PyMySQL驱动包来实现。 本次测试是在一台安装部署OBD的OceanBase 测试linux服务器上&#xff0c;通过python来远程操作OceanBase数据库。 一、Linux服务器通过Python3连接OceanBase数据库 1.1 安装pyth…...

vue3-hooks

hooks 把模块化 发挥到极致 命名规则&#xff1a; useDog.ts/useDog.js useXxx&#xff08;和xxx相关的所有内容&#xff09; 具体内容&#xff1a; export function que(){} 或者 export default function () { let dogList []; const getDog () > {} //向外…...

网络安全:构建数字世界的坚固防线

在当今数字化飞速发展的时代&#xff0c;网络已经渗透到我们生活的方方面面。从日常的社交娱乐、在线购物&#xff0c;到工作中的远程协作、数据存储与传输&#xff0c;网络无处不在。然而&#xff0c;随着网络的普及和应用的深入&#xff0c;网络安全问题也日益凸显&#xff0…...

Vision Transformer (ViT) 基本原理

Vision Transformer (ViT) 基本原理 flyfish Vision Transformer (ViT) 是一种基于 Transformer 架构的计算机视觉模型 一、ViT 的基本原理 ViT 的核心思想是将一张图像视为一组序列&#xff0c;将其嵌入到 Transformer 的输入中&#xff0c;通过自注意力机制捕获全局上下文…...

【青牛科技】拥有两个独立的、高增益、内部相位补偿的双运算放大器,可适用于单电源或双电源工作——D4558

概述&#xff1a; D4558内部包括有两个独立的、高增益、内部相位补偿的双运算放大器&#xff0c;可适用于单电源或双电源工作。该电路具有电压增益高、噪声低等特点。主要应用于音频信号放大&#xff0c;有源滤波器等场合。 D4558采用DIP8、SOP8的封装形式 主要特点&#xff…...

LCD与lvgl

LCD与lvgl 目录 LCD与lvgl 回顾 LCD 的驱动层讲解 1、LCD 的常见接口 2、我们的 LCD 的参数 3、LCD 的设备树说明 4、LCD 的设备树说明 5、如何移植 LCD 的驱动(重点) LCD 的应用层开发 1:LCD 应用开发->界面开发的方法 2:LVGL 模拟器安装 3:LVGL 工程创建和…...

大语言模型(2)--GPT-1

GPT-1是由OpenAI在2018年推出的第一代生成式预训练模型&#xff08;《Improving Language Understanding by Generative Pre-Training》&#xff09;&#xff0c;它采用了无监督预训练和有监督微调相结合的方法&#xff0c;以增强模型的通用任务求解能力。在此之前&#xff0c;…...

openstack内部rpc消息通信源码分析

我们知道openstack内部消息队列基于AMQP协议&#xff0c;默认使用的rabbitmq 消息队列。谈到rabbitmq&#xff0c;大家或许并不陌生&#xff0c;但或许会对oslo message有些陌生。openstack内部并不是直接使用rabbitmq&#xff0c;而是使用了oslo.message 。oslo.message 后端的…...

单端和差分信号的接线法

内容来源&#xff1a;【单端信号 差分信号与数据采集卡的【RSE】【 NRES】【 DIFF】 模式的连接】 此篇文章仅作笔记分享。 单端输入 单端信号指的是输入信号由一个参考端和一个信号端构成&#xff0c;参考端一般是地端&#xff0c;信号就是通过计算信号端口和地端的差值所得…...

服务器被ping的风险,如何开启和禁止ping?

允许服务器被ping&#xff08;即响应ICMP回显请求&#xff09;有其风险和好处。允许ping的主要好处是它可以帮助网络管理员快速检查服务器的连通性。然而&#xff0c;这也可能带来一些安全风险&#xff0c;例如&#xff1a; 暴露信息&#xff1a;响应ping请求可以让攻击者知道…...

pushgateway HA高可用方案

未经本人同意不得转载&#xff0c;若引用请附上原文链接。 项目使用flink来处理kafka中的无界流数据&#xff0c;采用的是flink on yarn的模式部署flink任务。最近做flink任务的监控过程中&#xff0c;踩了一些坑。下面是过程&#xff0c;只想看最终方案的直接拉到最后。 先说…...

在 Ubuntu Server 22.04 上安装 Docker 的详细步骤

本文档详细记录了在 Ubuntu Server 22.04 上安装 Docker 的完整过程&#xff0c;包括解决过程中遇到的问题。希望能对读者有所帮助。 安装过程&#xff0c;重点需要看官方文档。https://docs.docker.com/engine/install/ubuntu/ 步骤 1&#xff1a;卸载冲突的软件包 在安装 D…...

锻造船用发动机动力系统,铸强船舶“心脏”

船舶是海洋、湖泊及河流中重要的水上交通工具&#xff0c;不仅能够促进海上经济的发展&#xff0c;还能够保卫国家的制海权。船舶动力装置&#xff0c;也就是船舶的核心动力源——船用发动机动力系统对船舶的重要作用不言自明&#xff0c;关系到船舶的性能质量&#xff0c;能够…...

string类函数的手动实现

在上一篇文章中&#xff0c;我们讲解了一些string类的函数&#xff0c;但是对于我们要熟练掌握c是远远不够的&#xff0c;今天&#xff0c;我将手动实现一下这些函数~ 注意&#xff1a;本篇文章中会大量应用复用&#xff0c;这是一种很巧妙的方法 和以往一样&#xff0c;还是…...

前端工程化面试题(二)

前端模块化标准 CJS、ESM 和 UMD 的区别 CJS&#xff08;CommonJS&#xff09;、ESM&#xff08;ESModule&#xff09;和UMD&#xff08;Universal Module Definition&#xff09;是前端模块化标准的三种主要形式&#xff0c;它们各自有不同的特点和使用场景&#xff1a; CJS&…...

优化 LabVIEW 系统内存使用

在 LabVIEW 中&#xff0c;内存使用管理是确保高效系统性能的关键因素&#xff0c;尤其是在进行复杂的数据采集、信号处理和控制任务时。LabVIEW 程序的内存消耗可能会随着项目的规模和复杂度增加&#xff0c;导致性能下降&#xff0c;甚至出现内存溢出或程序崩溃。通过合理优化…...

pyqt6事件概要

例子&#xff1a; 利用qtdesigner建立闹钟 python代码 # 导入所需要的文件 from PyQt6.QtGui import QIcon, QPixmap from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton, QListWidgetItem from PyQt6 import uic from PyQt6.QtCore import Qt, QTime imp…...

鸿蒙分享(一):添加模块,修改app名称图标

码仓库&#xff1a;https://gitee.com/linguanzhong/share_harmonyos 鸿蒙api:12 新建公共模块common 在entry的oh-package.json5添加dependencies&#xff0c;引入common模块 "dependencies": {"common": "file:../common" } 修改app名称&…...

记忆泡沫垫市场:解锁舒适睡眠的黄金钥匙与增长潜力的深度剖析

在当今快节奏、高压力的生活中&#xff0c;优质睡眠已成为现代人追求健康生活的重要组成部分。记忆泡沫垫&#xff0c;作为床垫和枕头领域的一次革命性创新&#xff0c;凭借其独特的材质特性和对人体工学的完美贴合&#xff0c;正逐步成为改善睡眠质量的首选解决方案。本文将从…...

AI+电影特效产品化:开启电影人物年轻化新时代

随着人工智能技术的不断进步,它正在改变着我们生活的方方面面,包括娱乐产业。在电影制作领域,AI技术的应用尤其引人注目,尤其是在实现演员年轻化或老化效果方面。本文将介绍一款名为MyTimeMach...

探索 Python 应用的分层依赖:解决 UOS 环境中的 libvirt-python 安装问题

探索 Python 应用的分层依赖&#xff1a;解决 UOS 环境中的 libvirt-python 安装问题 背景Python 版本升级 问题描述原因分析与解决方案 Python 应用的分层依赖&#xff1a;安装与部署的视角libvirt-python的分层依赖尝试的解决方案 使用编译好的 .whl 文件"嫁接"整个…...

【MySQL 进阶之路】表级锁、行级锁详解

1. 表级锁和行级锁的概念及区别 表级锁&#xff08;Table Lock&#xff09; 表锁是一种较为粗粒度的锁&#xff0c;锁定的是整个表。当某个事务加锁表时&#xff0c;其他事务对该表的任何读写操作都会被阻塞&#xff0c;直到锁被释放。因此&#xff0c;表锁具有较高的冲突概率…...

FPGA系列,文章目录

前言 FPGA&#xff08;Field-Programmable Gate Array&#xff0c;现场可编程门阵列&#xff09;是一种集成电路&#xff0c;其内部结构可以通过软件重新配置来实现不同的逻辑功能。与传统的ASIC&#xff08;Application-Specific Integrated Circuit&#xff0c;专用集成电路…...

离谱的梯形滤波器——增加过渡点

增加过渡点 频率采样法&#xff08;Frequency Sampling Method&#xff09;是一种设计FIR滤波器的方法&#xff0c;通过在频域中指定希望的频率响应&#xff0c;然后利用逆离散傅里叶变换&#xff08;IDFT&#xff09;来获得滤波器的脉冲响应。然而&#xff0c;这种方法容易导…...

容积卡尔曼滤波(CKF)仿真抛物线运动

容积卡尔曼滤波&#xff08;CKF&#xff09;仿真抛物线运动 容积卡尔曼滤波&#xff08;Cubature Kalman Filter, CKF&#xff09;的MATLAB实现。CKF是一种用于非线性系统状态估计的算法&#xff0c;它通过在状态空间中采样点&#xff08;容积点&#xff09;来近似非线性函数的…...

FlightGear+MATLAB+飞行手柄实现实时飞控视景系统

文章目录 一、软件配置二、FlightGearMATLAB联合仿真第一步 复制文件第二步 新建文件夹第三步 打开demo第四步 demo说明第五步 打开Simulink第六步 连接FlightGear第七步 设置FlightGear第八步 生成FlightGear连接文件FlightGear的设置Network的设置File的设置生成.bat文件 第九…...

Oracle 11g Data Guard 环境中的 GAP 处理办法

概述 在Data Guard 环境中&#xff0c;当主库的某些日志没有成功传送到备库时&#xff0c;就会发生归档裂缝&#xff08;Archive Gap&#xff09;。目前&#xff0c;Oracle 提供了两种日志 GAP 的检测和处理机制&#xff1a;自动 GAP 处理&#xff08;Automatic Gap Resolutio…...

自建服务器,数据安全有保障

在远程桌面工具的选择上&#xff0c;向日葵和TeamViewer功能强大&#xff0c;但都存在收费昂贵、依赖第三方服务器、数据隐私难以完全掌控等问题。相比之下&#xff0c;RustDesk 凭借开源免费、自建服务的特性脱颖而出&#xff01;用户可以在自己的服务器上部署RustDesk服务端&…...

华为HarmonyOS 快速构建各种文本识别应用 -- 通用文字识别

适用场景 通用文字识别&#xff0c;是通过拍照、扫描等光学输入方式&#xff0c;将各种票据、卡证、表格、报刊、书籍等印刷品文字转化为图像信息&#xff0c;再利用文字识别技术将图像信息转化为计算机等设备可以使用的字符信息的技术。 可以对文档翻拍、街景翻拍等图片进行…...

shell作业

计算器 #!/bin/bash num1$1 num2$3 op$2 case $op in"")echo $((num1 num2));;"-")echo $((num1 - num2));;"*")echo $((num1 * num2));;"/")if [ $num2 -ne 0 ]; thenecho $((num1 / num2))elseecho "除数不能为0"fi;;*)…...

css部分

前面我们学习了HTML&#xff0c;但是HTML仅仅只是做数据的显示&#xff0c;页面的样式比较简陋&#xff0c;用户体验度不高&#xff0c;所以需要通过CSS来完成对页面的修饰&#xff0c;CSS就是页面的装饰者&#xff0c;给页面化妆&#xff0c;让它更好看。 1 层叠样式表&#…...

nginx 配置 跨域、压缩、文件下载 、静态文件、防盗链

1.跨域配置 在server模块下 访问如&#xff1a;http://127.0.0.1:8080/static/a.txt #跨域server {listen 8080;server_name localhost;#允许跨域请求的域&#xff0c; *代表所有add_header Access-Control-Allow-Origin *;#允许带上cookie请求add_header Access-Contro…...

SQL教程(1):什么是SQL?有什么用?

如果你是刚接触用户研究的新手&#xff0c;可能会听说过一个词叫做 SQL&#xff08;Structured Query Language&#xff0c;结构化查询语言&#xff09;&#xff0c;但你可能还不太清楚它是什么&#xff0c;如何使用它&#xff0c;或者为什么它会对你的用户研究有帮助。别担心&…...

c++笔记2

14、c的对象 对象和结构的区别&#xff1b; 结构&#xff1a;包含各种类型的变量&#xff1b; 对象&#xff1a;包含各种函数、和变量&#xff1b; 设计对象的时候引用class关键字创建类&#xff0c;和结构形状差不多&#xff1b; 将变量称之为属性&#xff0c;函数称之为方…...

Xlsxwriter生成Excel文件时TypeError异常处理

在使用 XlsxWriter 生成 Excel 文件时&#xff0c;如果遇到 TypeError&#xff0c;通常是因为尝试写入的值或格式与 XlsxWriter 的限制或要求不兼容。 1、问题背景 在使用 Xlsxwriter 库生成 Excel 文件时&#xff0c;出现 TypeError: “expected string or buffer” 异常。此…...

应用层协议/传输层协议(UDP)

目录 应用层 如何自定义应用层协议&#xff1f; 序列化方式 1.基于行文本的方式来传输 2.基于xml的方式 3.基于json的方式 4.yml的形式 5.protobuffer(pb)形式 传输层 端口号 协议 UDP 校验和 CRC TCP TCP/IP五层协议 应用层 -- 传输层 -- 网络层 -- 数据链路层…...

【Linux】应用层协议—HTTP

一、HTTP协议介绍 请求-响应模型&#xff1a;HTTP (Hyper Text Transfer Protocol) 协议是基于请求和响应的。客户端&#xff08;如Web浏览器&#xff09;发送一个HTTP请求到服务器&#xff0c;服务器处理请求后返回一个HTTP响应。 无状态&#xff0c;无连接协议&#xff1a;H…...

使用Vue3+Echarts实现加载中国地图,点击省份地图下钻(完整教程)

一. 前言 在众多 ECharts 图表类型中&#xff0c;开发者始终绕不开的有各种各样的地图开发&#xff0c;关于地图开发&#xff0c;可能比其他图表相对繁琐一些&#xff0c;其实说简单也简单&#xff0c;说复杂也复杂&#xff0c;其中不乏有层级地图、3D 地图等&#xff0c;感觉…...

双目相机的标定,视差图,深度图,点云生成思路与实现。

该文档记录从双目相机标定到点云生成的所有过程&#xff0c;同时会附上代码。 代码直接能跑。https://github.com/stu-yzZ/stereoCamera 目录 大致思路如下&#xff1a; 一、相机标定 1、相机参数介绍 2、单目相机标定 3、双目相机标定 二、图片畸变矫正 三、极线矫正…...

解决 minio上传文件Service: S3, Status Code: 403

错误信息 [software.amazon.awssdk.services.s3.model.S3Exception: (Service: S3, Status Code: 403, Request ID: 180E9BC04F11312E, Extended Request ID: 81aefed089495c5faf6270c59bea93c9783926f74ef647fe6b17908f0976b557)]分析过程 4XX一般是客户端错误。403表示禁止…...