V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  zhangysh1995  ›  全部回复第 15 页 / 共 18 页
回复总数  345
1 ... 7  8  9  10  11  12  13  14  15  16 ... 18  
2020-06-24 16:51:55 +08:00
回复了 demonps 创建的主题 程序员 请教这条 mysql 优化出路在哪?
自己打下脸,好像 (c_type, cat_id) 可以优化

https://dev.mysql.com/doc/refman/8.0/en/range-optimization.html#row-constructor-range-optimization

Only IN() predicates are used, not NOT IN().
On the left side of the IN() predicate, the row constructor contains only column references.
On the right side of the IN() predicate, row constructors contain only runtime constants, which are either literals or local column references that are bound to constants during execution.
On the right side of the IN() predicate, there is more than one row constructor.
2020-06-24 16:39:55 +08:00
回复了 demonps 创建的主题 程序员 请教这条 mysql 优化出路在哪?
https://dev.mysql.com/doc/refman/8.0/en/multiple-column-indexes.html 文档

MySQL can use multiple-column indexes for queries that test all the columns in the index, or queries that test just the first column, the first two columns, the first three columns, and so on. If you specify the columns in the right order in the index definition, a single composite index can speed up several kinds of queries on the same table.
2020-06-24 16:37:17 +08:00
回复了 demonps 创建的主题 程序员 请教这条 mysql 优化出路在哪?
(c_type, cat_id) 是索引的一部分,所以建的索引不能用,慢
where 里面的 col 都不能用索引,慢
2020-06-17 21:34:01 +08:00
回复了 NewConn 创建的主题 程序员 关于几张超大表联合查询查询 SQL 的问题
@NewConn 不好意思我是妹子。
2020-06-16 18:43:02 +08:00
回复了 NewConn 创建的主题 程序员 关于几张超大表联合查询查询 SQL 的问题
WITH E AS (
SELECT ID
FROM A
WHERE type = 2
AND DELETE_FLAG = 0
AND uid = 41
UNION
SELECT a.ID
FROM A a, B b, A c
WHERE a.type = 3
AND a.DELETE_FLAG = 0
AND a.uid = 41
AND a.ID = b.ID
AND b.parent_id = c.ID
)

这里面为什么不能先把 a.type in (2,3) and a.delete_flag =0 and a.uid = 41 先选择出来然后再别的操作?这一句的 selectivity 有多少?有多少符合条件的?
2020-05-19 17:31:25 +08:00
回复了 0000zjn 创建的主题 MySQL MySQL 在线增加表注释、行注释是否会锁表
ALTER TABLE operations are processed using one of the following algorithms:

COPY: Operations are performed on a copy of the original table, and table data is copied from the original table to the new table row by row. Concurrent DML is not permitted.
不可以并发

INPLACE: Operations avoid copying table data but may rebuild the table in place. An exclusive metadata lock on the table may be taken briefly during preparation and execution phases of the operation. Typically, concurrent DML is supported.
可能加锁,一般可以并发

INSTANT: Operations only modify metadata in the data dictionary. No exclusive metadata locks are taken on the table during preparation and execution, and table data is unaffected, making operations instantaneous. Concurrent DML is permitted. (Introduced in MySQL 8.0.12)
允许并发

https://dev.mysql.com/doc/refman/8.0/en/alter-table.html
2020-05-09 18:34:00 +08:00
回复了 yukiloh 创建的主题 MySQL 有什么学习数据库的好资源吗
@yukiloh 我是学生。工作的时候碰到问题去搜索,其实就是把这个时间转嫁到实际操作的时候学习了。这个本科课程内容也没多少,认真一下,只了解概念,两三周绝对够了。
2020-05-08 14:12:52 +08:00
回复了 zhangysh1995 创建的主题 程序员 DB Fiddle 有国产替代品吗?
发现一个 http://sqlfiddle.com/ 就是广告有点明显。。。错误提示比 DB Fiddle 详细。
2020-05-08 14:08:33 +08:00
回复了 qiushaox 创建的主题 程序员 静态代码检查工具 coverity 怎样?
@gainsurier 有在招聘的。
2020-05-08 14:06:19 +08:00
回复了 yukiloh 创建的主题 MySQL 有什么学习数据库的好资源吗
学习一下 CMU 的数据库课程吧,两个部分,本科的主要是基本概念,研究生的讲前沿研究和思考一些问题。https://15445.courses.cs.cmu.edu/fall2019/ https://15721.courses.cs.cmu.edu/spring2020/
我基本看完了 15-445,收获很大,至少知道有问题应该去找什么样的资料。如果不是急着工作,不建议看动物书,非常应用,并且每个数据库都不一样。先打好基础,多练习一下,在 v 站看别人发的问题学习一下,再看针对某一个数据库的也不迟。
2020-05-08 13:58:46 +08:00
回复了 Colorful 创建的主题 Python 请教个爬 虫存 mysql 的问题
添加 try except,抓 mysql.connector.errors.DatabaseError 错误
2020-05-08 13:53:57 +08:00
回复了 jss 创建的主题 程序员 [求优化] mysql 百万数据 IN 查询
@kanepan19 这样的啊,学习了。谢谢回复!
2020-05-07 14:23:28 +08:00
回复了 jss 创建的主题 程序员 [求优化] mysql 百万数据 IN 查询
@hauzi `范围查询一般都不走索引的`,这是从经验来的嘛?我看文档 https://dev.mysql.com/doc/refman/5.6/en/range-optimization.html 说的是 indexed key 都会做优化?
2020-05-07 14:17:56 +08:00
回复了 jss 创建的主题 程序员 [求优化] mysql 百万数据 IN 查询
不一定需要 `FORCE INDEX`,尝试一下 `USE INDEX`。https://dev.mysql.com/doc/refman/8.0/en/index-hints.html
2020-05-07 14:16:26 +08:00
回复了 jss 创建的主题 程序员 [求优化] mysql 百万数据 IN 查询
@zhou451971886 为什么要关闭这个优化?
2020-04-29 19:16:51 +08:00
回复了 zhangysh1995 创建的主题 程序员 DB Fiddle 有国产替代品吗?
@XanderChen 付费的也行。叫什么名字?
2020-04-26 13:55:17 +08:00
回复了 zhangysh1995 创建的主题 程序员 DB Fiddle 有国产替代品吗?
up !
考虑一下验证方法,把这篇论文实现,The essence of command injection attacks in web applications
1 ... 7  8  9  10  11  12  13  14  15  16 ... 18  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1314 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms · UTC 23:39 · PVG 07:39 · LAX 16:39 · JFK 19:39
Developed with CodeLauncher
♥ Do have faith in what you're doing.