随笔分类 -  mysql

摘要:详见 这里 Let's say I have code like this: The PDO documentation says: Is that truly all I need to do to avoid SQL injections? Is it really that easy? You 阅读全文
posted @ 2018-10-25 16:38 taek 阅读(989) 评论(0) 推荐(0)
摘要:详见 https://stackoverflow.com/questions/134099/are-pdo-prepared-statements-sufficient-to-prevent-sql-injection/12202218#12202218 php pdo prepare真的能防止sq 阅读全文
posted @ 2018-10-25 14:14 taek 阅读(472) 评论(0) 推荐(0)
摘要:https://www.zhihu.com/question/36996520 之前对于联合索引有一个误区, 假设 name,age为一个联合索引 5条索引记录 a 10 b 5 c 12 c 15 d 2 当查找 where name='a' and age=10的时候能利用这个联合索引,为什么 阅读全文
posted @ 2018-03-21 23:20 taek 阅读(407) 评论(0) 推荐(0)
摘要:1) wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py 2) python ez_setup.py --insecure 3) wget https://pypi.python.org/packages/11/b6/a 阅读全文
posted @ 2017-07-10 10:31 taek 阅读(212) 评论(0) 推荐(0)
摘要:innodb 的聚集索引 的叶子结点 存放的 是 索引值以及数据页的偏移量 那么在计算全表扫描的代价是怎么计算的呢? 我们知道代价 为 cpu代价+io代价 cpu代价 就是 每5条记录比对 计算一个代价 (这里的记录并不是我们数据记录,而是索引记录) 是数据记录个数 又是如何取出全表的总记录呢 ( 阅读全文
posted @ 2017-03-31 19:02 taek 阅读(1630) 评论(0) 推荐(0)
摘要:mysql cbo cost base optimizer 基于代价,数据是一直变化的oracle8 以前是rbo rule base optimizer 基于规则, 如果sql使用了索引,必须使用索引,尽管全表扫描比索引快 代价= cpu cost + io cost1)计算全表扫描代价 a)cp 阅读全文
posted @ 2017-03-28 18:42 taek 阅读(409) 评论(0) 推荐(1)
摘要:typedef struct st_key { uint key_length; /* Tot length of key */ ulong flags; /* dupp key and pack flags */ uint key_parts; /* How many ke... 阅读全文
posted @ 2016-02-25 15:11 taek 阅读(251) 评论(0) 推荐(0)
摘要:typedef struct keyuse_t { TABLE *table; Item *val; /** equality condition is on *cond_guard == FALSE equality condition is off NULL - Otherwise (the sourc... 阅读全文
posted @ 2016-02-25 15:06 taek 阅读(193) 评论(0) 推荐(0)
摘要:class JOIN :public Sql_alloc { JOIN(const JOIN &rhs); /** *fields; List group_fields, group_fields_cache; TABLE *tmp_table; /// used to store 2 possible tmp table ... 阅读全文
posted @ 2016-02-05 11:42 taek 阅读(204) 评论(0) 推荐(0)
摘要:typedef struct st_join_table { st_join_table() {} /* Remove gcc warning */ TABLE *table; KEYUSE *keyuse; /**select->quick. MySQL needs this i... 阅读全文
posted @ 2016-02-05 11:42 taek 阅读(247) 评论(0) 推荐(0)
摘要:1.找到mysqld的id [root@default-tpl ~]# ps aux|grep mysqldroot 5006 0.0 0.0 103252 796 pts/6 S+ 15:15 0:00 grep mysqldmysql 27888 0.0 4.0 817168 47068 ? S 阅读全文
posted @ 2016-02-01 15:23 taek 阅读(221) 评论(0) 推荐(0)
摘要:http://www.tamabc.com/article/85038.html 从MySQL Bug#67718浅谈B+树索引的分裂优化 原文链接:http://hedengcheng.com/?p=525 问题背景 今天,看到Twitter的DBA团队发布了其最新的MySQL分支:Changes 阅读全文
posted @ 2016-01-30 15:00 taek 阅读(2784) 评论(0) 推荐(1)
摘要:class JOIN :public Sql_alloc { JOIN(const JOIN &rhs); /** *fields; List group_fields, group_fields_cache; TABLE *tmp_table; /// used to store 2 possible tmp table ... 阅读全文
posted @ 2015-12-30 12:05 taek 阅读(224) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/xpchild/p/3770823.html http://blog.sae.sina.com.cn/archives/3968 实例 http://blog.sae.sina.com.cn/archives/3968 http://www.cnblog 阅读全文
posted @ 2015-12-24 16:48 taek 阅读(436) 评论(0) 推荐(0)
摘要:http://guduwhuzhe.iteye.com/blog/1887619 http://backend.wap.blog.163.com/w2/blogDetail.do?blogId=fks_0870660800950870710820830840680720840810650860950 阅读全文
posted @ 2015-12-24 16:01 taek 阅读(433) 评论(0) 推荐(0)
摘要:http://mysql.taobao.org/monthly/2015/08/07/ 阅读全文
posted @ 2015-12-23 20:37 taek 阅读(385) 评论(0) 推荐(0)
摘要:参考 http://www.cnblogs.com/justfortaste/p/3198406.html http://m.blog.csdn.net/blog/IT_PCode/17007833 http://blog.chinaunix.net/uid-28364803-id-3419777. 阅读全文
posted @ 2015-12-20 18:02 taek 阅读(1390) 评论(0) 推荐(0)
摘要:转载 https://www.zhihu.com/question/19866767/answer/14942009 http://whuai.blog.51cto.com/3539000/862197 Oracle: 数据文件包括:控制文件、数据文件、重做日志文件、参数文件、归档文件、密码文件。这 阅读全文
posted @ 2015-12-18 23:29 taek 阅读(1172) 评论(0) 推荐(0)
摘要:/***********************************************************************//** Reads the next or previous row from a cursor, which must have previously been positioned using index_read. @return 0,... 阅读全文
posted @ 2015-12-16 23:19 taek 阅读(347) 评论(0) 推荐(0)
摘要:/*****************************************************************//** Reads the next row in a table scan (also used to read the FIRST row in a table scan). @return 0, HA_ERR_END_OF_FILE, or err... 阅读全文
posted @ 2015-12-12 00:02 taek 阅读(204) 评论(0) 推荐(0)