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

做html网站模板网站推广做多大尺寸

做html网站模板,网站推广做多大尺寸,wordpress 当前页面名称,网站 用php asp源码 比较好cursor.explain(“executionStats”)和 db.collection.explain(“executionStats”) 方法提供关于查询性能的相关信息。这些信息可用于衡量查询是否使用了索引以及如何使用索引。 db.collection.explain() 还提供有关其他操作的执行信息。例如 db.collection.update()。 有关详…cursor.explain(“executionStats”)和 db.collection.explain(“executionStats”) 方法提供关于查询性能的相关信息。这些信息可用于衡量查询是否使用了索引以及如何使用索引。 db.collection.explain() 还提供有关其他操作的执行信息。例如 db.collection.update()。 有关详情信息请参见 db.collection.explain() 。 评价查询性能 考虑采用以下的 inventory 集合文档 db.inventory.insert([{ _id : 1, item : f1, type: food, quantity: 500 },{ _id : 2, item : f2, type: food, quantity: 100 },{ _id : 3, item : p1, type: paper, quantity: 200 },{ _id : 4, item : p2, type: paper, quantity: 150 },{ _id : 5, item : f3, type: food, quantity: 300 },{ _id : 6, item : t1, type: toys, quantity: 500 },{ _id : 7, item : a1, type: apparel, quantity: 250 },{ _id : 8, item : a2, type: apparel, quantity: 400 },{ _id : 9, item : t2, type: toys, quantity: 50 },{ _id : 10, item : f4, type: food, quantity: 75 } ]);不使用索引查询 以下查询返回 quantity 值在 100 到 200 之间含的文档 db.inventory.find( { quantity: { $gte: 100, $lte: 200 } } )将cursor.explain(“executionStats”)游标方法拼接到find 命令的结尾显示查询选择的计划 db.inventory.find({ quantity: { $gte: 100, $lte: 200 } } ).explain(executionStats)explain() 方法返回如下结果 {queryPlanner : {plannerVersion : 1,...winningPlan : {stage : COLLSCAN,...}},executionStats : {executionSuccess : true,nReturned : 3,executionTimeMillis : 0,totalKeysExamined : 0,totalDocsExamined : 10,executionStages : {stage : COLLSCAN,...},...},... }queryPlanner.winningPlan.stage 显示 COLLSCAN 表示集合扫描。 集合扫描表示mongod必须按照文档扫描整个文档集合来匹配结果。这通常是昂贵的操作可能导致查询速度慢。 executionStats.nReturned 显示3表示查询匹配到并返回3个文档。 executionStats.totalKeysExamined 显示0表示这个查询没有使用索引。 executionStats.totalDocsExamined 显示10表示MongoDB扫描了10个文档从中查询匹配到3个文档。 匹配文档的数量与检查文档的数量之间的差异可能意味着查询可以使用索引提高的查询效率。 基于索引查询 为了查询支持 quantity 字段在 quantity 字段上新增索引 db.inventory.createIndex( { quantity: 1 } )使用 explain(“executionStats”) 方法显示查询计划信息 db.inventory.find({ quantity: { $gte: 100, $lte: 200 } } ).explain(executionStats)这个 explain() 方法返回如下结果信息: {queryPlanner : {plannerVersion : 1,...winningPlan : {stage : FETCH,inputStage : {stage : IXSCAN,keyPattern : {quantity : 1},...}},rejectedPlans : [ ]},executionStats : {executionSuccess : true,nReturned : 3,executionTimeMillis : 0,totalKeysExamined : 3,totalDocsExamined : 3,executionStages : {...},...},... }queryPlanner.winningPlan.inputStage.stage 显示 IXSCAN 表示使用了索引。executionStats.nReturned 显示3表示查询匹配到并返回3个文档。executionStats.totalKeysExamined 显示3表示MongoDB 扫描了3个索引数据。 检查的键数与返回的文档数相匹配这意味着mongod只需检查索引键即可返回结果。mongod不必扫描所有文档只有三个匹配的文档被拉入内存。 这个查询结果是非常高效的。executionStats.totalDocsExamined 显示3表示MongoDB扫描了3个文档。 没有使用索引时查询将扫描整个集合中的10个文档返回匹配到的3个文档。查询时会将它们拉入内存并扫描每个文档的整体。这个结果非常耗性能并且潜在的会导致查询变慢。 当使用索引运行时查询扫描3个索引条目然后3个文档中返回匹配到的3个文档这个查询结果非常高效。 比较索引的性能 查询时不止一个索引时手动的比较索引性能可以使用 hint() 方法再结合 explain() 方法。 考虑下面的查询 db.inventory.find( {quantity: {$gte: 100, $lte: 300},type: food } )查询结果如下 { _id : 2, item : f2, type : food, quantity : 100 } { _id : 5, item : f3, type : food, quantity : 300 }为了支持这个查询添加复合索引。复合索引中字段的顺序很重要。 例如添加如下的2个复合索引。第一个索引先使用 quantity 再使用 type 字段创建索引。第二个索引先使用 type 再使用 quantity 字段创建索引。 db.inventory.createIndex( { quantity: 1, type: 1 } ) db.inventory.createIndex( { type: 1, quantity: 1 } )查询使用第一个索引来评估性能 db.inventory.find({ quantity: { $gte: 100, $lte: 300 }, type: food } ).hint({ quantity: 1, type: 1 }).explain(executionStats)这个 explain() 方法返回如下输出信息: {queryPlanner : {...winningPlan : {stage : FETCH,inputStage : {stage : IXSCAN,keyPattern : {quantity : 1,type : 1},...}}},rejectedPlans : [ ]},executionStats : {executionSuccess : true,nReturned : 2,executionTimeMillis : 0,totalKeysExamined : 6,totalDocsExamined : 2,executionStages : {...}},... }MongoDB 扫描了6条索引键 (executionStats.totalKeysExamined) 并返回了2条匹配到的文档(executionStats.nReturned)。 查询使用第二个索引来评估性能 db.inventory.find({ quantity: { $gte: 100, $lte: 300 }, type: food } ).hint({ type: 1, quantity: 1 }).explain(executionStats)这个 explain() 方法返回如下输出信息: {queryPlanner : {...winningPlan : {stage : FETCH,inputStage : {stage : IXSCAN,keyPattern : {type : 1,quantity : 1},...}},rejectedPlans : [ ]},executionStats : {executionSuccess : true,nReturned : 2,executionTimeMillis : 0,totalKeysExamined : 2,totalDocsExamined : 2,executionStages : {...}},... }MongoDB 扫描了2条索引键 (executionStats.totalKeysExamined) 并返回了2条匹配到的文档(executionStats.nReturned)。 这个查询例子中复合索引 {type1quantity1} 比复合索引 {quantity1type1} 更高效。 个人博客 学习园
http://www.yutouwan.com/news/339053/

相关文章:

  • 网站要怎么做的吗湖北专业的网瘾戒除学校地址
  • 关于门户网站建设的整改报告网站开发技术参数
  • 做微信公众号必备的网站企石网站建设
  • 珠海专业制作网站购物展示网站开发的背景
  • 什么网站的图片可以做商用临沂培训学校网站建设
  • 关键词挖掘爱网站上海企业在线登记
  • 如何在自己网站上做支付宝微信的微网站模板下载安装
  • 个人信息页面设计漂亮的网站利尔化学股票最新消息
  • 博客网站的建设网站备案才能使用
  • 秦皇岛做网站网站的下拉列表怎么做的
  • 电子商务的网站开发的工作内容义乌制作网站开发
  • 企业简介 网站建设温江网站建设
  • asp网站数据库连接为什么做红酒网站
  • 一级域名和二级域名跨域seo技术是什么意思
  • 网站建设丶金手指下拉12wordpress答题插件
  • 佛山手机网站建设网站开发猪八戒
  • 出国自助游做攻略的网站旅游公司注册条件
  • 开放大学门户网站建设网站建设产品介绍
  • 免费网站平台做攻略的网站
  • 一键制作网站软件站中站网站案例
  • 网站换模板要怎么做网站导入页欣赏
  • 想建立什么网站吗区总工会加强网站意识形态建设
  • 做企业网站好的从哪些方面评价一个企业的网站建设
  • 东莞汽车总站停止营业受欢迎的天津网站建设
  • 做羞羞事免费网站关键词智能优化排名
  • 北京网站设计制作教程中煜建设有限公司网站
  • 网站设计的布局免费域名注册推荐
  • 常州网站推广软件德国网站域名后缀
  • 哪家做外贸网站好网站主播
  • asp.net网站开发教程想找在家做的兼职 有什么网站吗