暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
understanding_explain
390
42页
0次
2020-01-09
5墨值下载
Understanding EXPLAIN
Understanding EXPLAIN
Table des matières
Understanding EXPLAIN....................................................................................................................4
1 Slides license................................................................................................................................5
2 Author..........................................................................................................................................5
3 How can I understand EXPLAIN?..............................................................................................6
4 First, our objects..........................................................................................................................6
5 Let's try to read our table.............................................................................................................7
6 Let's update our table statistics....................................................................................................8
7 What does ANALYZE do?..........................................................................................................8
8 Width............................................................................................................................................9
9 Rows..........................................................................................................................................10
10 Total cost..................................................................................................................................10
11 But what happens really?.........................................................................................................11
12 And at the physical level?........................................................................................................12
13 Let's use the BUFFERS option................................................................................................12
14 And now, with a warm up cache?............................................................................................13
15 Let's try with a bigger cache....................................................................................................14
16 By the way...............................................................................................................................14
17 Now, let's try a WHERE clause...............................................................................................15
18 Cost - more complicated process.............................................................................................16
19 Number of rows - ditto.............................................................................................................17
20 Would an index help here?.......................................................................................................17
21 Why not use the index?............................................................................................................18
22 Let's try to force the use of index.............................................................................................19
23 Let's see with another query....................................................................................................19
24 Let's complicate the filter.........................................................................................................20
25 Let's try to filter on c2 only......................................................................................................20
26 Let's add an index on c2...........................................................................................................21
27 Let's add an index with an opclass...........................................................................................21
28 Let's try a covering index.........................................................................................................22
29 All the major scan nodes..........................................................................................................23
30 Let's try an ORDER BY clause................................................................................................23
31 Are we sure it writes on the disk?............................................................................................24
32 Let's bring more mem to the sort.............................................................................................25
33 An index can also help here.....................................................................................................25
34 Let's get back to c2..................................................................................................................26
35 And now, let's limit the rows....................................................................................................26
36 Let's have another table...........................................................................................................27
37 ... and join them.......................................................................................................................27
38 It helps to have an index..........................................................................................................28
39 Left join anyone?.....................................................................................................................29
40 Let's DROP an index................................................................................................................29
41 We delete some more row........................................................................................................30
42 And with an empty table?........................................................................................................31
43 Always used in a CROSS JOIN...............................................................................................31
44 All the join nodes.....................................................................................................................32
2 / 42
of 42
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜