今天做一个订单任务, 其中需要查有无此订单号信息, 由于订单号是个列表, 所以想检测下如下语句的性能(主要在LIMIT 1上)"订单号 IN (订单号列表)" LIMIT 1然后就复习了下EXPLAIN的用法:explain显示了mysql如何使用索引来处理select语句以及连接表。可以帮助选择更...
                            
                            
                                分类:
数据库   时间:
2014-10-28 13:29:04   
                                阅读次数:
234
                             
                    
                        
                            
                            
                                Variables are a fundamental building block of all programming languages. In this lesson, I'll describe briefly what a variable is, explain the basic r...
                            
                            
                                分类:
其他好文   时间:
2014-10-28 09:21:40   
                                阅读次数:
253
                             
                    
                        
                            
                            
                                I explain what you need to start working with PHP. Before doing so, I think it'll be useful to explain what PHP is and how it works. PHP stands for PH...
                            
                            
                                分类:
Web程序   时间:
2014-10-28 09:18:03   
                                阅读次数:
276
                             
                    
                        
                            
                            
                                Before getting down to to the business of writing some real PHP, I want to take a few minutes to explain some basics. PHP needs to be processed by the...
                            
                            
                                分类:
Web程序   时间:
2014-10-28 09:15:05   
                                阅读次数:
314
                             
                    
                        
                            
                            
                                上一篇博客讲了可以使用慢查询日志定位耗时sql,使用explain命令查看mysql的执行计划,以及使用profiling工具查看语句执行真正耗时的地方,当定位了耗时之后怎样优化呢?这篇博客会介绍mysql中最简单快速的优化方法——添加索引。一、索引的添加 ...
                            
                            
                                分类:
数据库   时间:
2014-10-28 09:13:29   
                                阅读次数:
247
                             
                    
                        
                            
                            
                                mysql 手册中没有关于key_length的详细介绍,经过试验验证了key_length的计算方式。 当索引字段为定长数据类型,比如char,int,datetime,如果有是否为NULL的标记,这个标记需要占用1个字节。对于变长数据类型,...
                            
                            
                                分类:
数据库   时间:
2014-10-26 17:06:04   
                                阅读次数:
223
                             
                    
                        
                            
                            
                                当你在用explain工具查看sql语句的执行计划时,若select_type 字段中出现“DEPENDENT SUBQUERY”时,你要注意了,你已经掉入了mysql子查询慢的“坑"。。。下面我们来看一个具体的例子	有这样一条查询语句:        SELECT gid,COUNT(id) as count FROM shop_goods g1 WHERE status =0 and gid...
                            
                            
                                分类:
数据库   时间:
2014-10-25 23:08:20   
                                阅读次数:
467
                             
                    
                        
                            
                            
                                最近监控数据库,发现下面语句跑得非常慢,原来执行计划走了导致笛卡尔积,来看下面语句:
SQL> explain plan for
  2  SELECT COUNT(*)
  3    FROM "GD_FS"."TZZ_SJ_DEV_DISC_79073" "A2",
  4         "GD_FS"."TZZ_SJ_DEVELOP_MONTH"  "A1"
  5   WHERE "A...
                            
                            
                                分类:
其他好文   时间:
2014-10-24 19:02:03   
                                阅读次数:
247
                             
                    
                        
                            
                            
                                Following code explain how 'global' works in the distinction of global variable and local variable. 1 var = 'Global Variable' 2 print(var) 3 4 def fu....
                            
                            
                                分类:
编程语言   时间:
2014-10-22 12:37:34   
                                阅读次数:
161
                             
                    
                        
                            
                            
                                The title sounds a bit awkward, let my briefly explain what is it all about.In my program, I want to wait for user input, but at the same time, I want...
                            
                            
                                分类:
其他好文   时间:
2014-10-17 01:19:53   
                                阅读次数:
434