首页 > 其他分享 >脚本exlpain结果与optimizer_trace结果不一致

脚本exlpain结果与optimizer_trace结果不一致

时间:2024-01-24 18:14:10浏览次数:25  
标签:COMMENT map optimizer trace no DEFAULT cell exlpain id

先说结论:

表数据量太少,使用索引的效率不如全表扫描。

表信息:

CREATE TABLE `w_map_cell` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`shelf_id` bigint(11) DEFAULT NULL COMMENT '货架id',
`cell_no` varchar(50) DEFAULT NULL COMMENT '储位编号',
`cell_name` varchar(50) DEFAULT NULL COMMENT '储位名称',
`rend_x` double DEFAULT NULL COMMENT '货架坐标x',
`rend_y` double DEFAULT NULL COMMENT '货架坐标y',
`floor_in` int(11) DEFAULT NULL COMMENT '第几层',
`span_code` varchar(50) DEFAULT NULL COMMENT '储位所在跨度',
`distribution_name` varchar(32) DEFAULT NULL COMMENT '配送中心名称名称',
`distribution_no` bigint(32) DEFAULT NULL COMMENT '大区编号',
`ware_name` varchar(32) DEFAULT NULL COMMENT '仓库名称',
`ware_no` bigint(32) NOT NULL COMMENT '仓库编号',
`create_user` varchar(45) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(45) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`yn` tinyint(2) DEFAULT '0' COMMENT '删除标识',
`ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '时间戳',
`cell_length` double DEFAULT '0' COMMENT '储位长度',
`cell_width` double DEFAULT '0' COMMENT '储位宽度',
PRIMARY KEY (`id`,`ware_no`),
KEY `idx_cellNo` (`cell_no`),
KEY `uniq_shelfId_distributionNo_wareNo` (`shelf_id`,`distribution_no`,`ware_no`)
) ENGINE=InnoDB AUTO_INCREMENT=9652906 DEFAULT CHARSET=utf8 COMMENT='储位表'
/*!50100 PARTITION BY HASH (ware_no)
PARTITIONS 64 */

exlpain结果(全表扫描):

explain select id, shelf_id, cell_no, cell_name, cell_width, cell_length, rend_x, rend_y, floor_in, span_code from w_map_cell where yn = 0 and shelf_id in ( 40001 , 40002 , 40003 , 40004 , 40005 , 40006 , 40007 , 40008 , 40009 , 40010 , 40011, 40012 , 40013, 40014 , 40015, 40016 , 40017 , 40018 , 40019 , 40020 , 40021 , 40022, 40023 , 40024 , 40025 , 40026 , 40027 , 40028 , 40029 , 40030, 40031 , 40032 , 40033 , 40034 , 40035, 40036, 40037 , 40038 , 40039, 40040) and distribution_no = 696 and ware_no = 52

id

select_type

table

type

possible_keys

key

key_len

ref

rows

Extra

1

SIMPLE

w_map_cell

ALL

uniq_shelfId_distributionNo_wareNo

 

 

 

3,295

Using where

optimizer_trace结果(走索引):

{
  "steps": [
    {
      "join_preparation": {
        "select#": 1,
        "steps": [
          {
            "expanded_query": "/* select#1 */ select `w_map_cell`.`id` AS `id`,`w_map_cell`.`shelf_id` AS `shelf_id`,`w_map_cell`.`cell_no` AS `cell_no`,`w_map_cell`.`cell_name` AS `cell_name`,`w_map_cell`.`cell_width` AS `cell_width`,`w_map_cell`.`cell_length` AS `cell_length`,`w_map_cell`.`rend_x` AS `rend_x`,`w_map_cell`.`rend_y` AS `rend_y`,`w_map_cell`.`floor_in` AS `floor_in`,`w_map_cell`.`span_code` AS `span_code` from `w_map_cell` where ((`w_map_cell`.`yn` = 0) and (`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)) and (`w_map_cell`.`distribution_no` = 696) and (`w_map_cell`.`ware_no` = 52)) limit 0,200"
          }
        ] /* steps */
      } /* join_preparation */
    },
    {
      "join_optimization": {
        "select#": 1,
        "steps": [
          {
            "condition_processing": {
              "condition": "WHERE",
              "original_condition": "((`w_map_cell`.`yn` = 0) and (`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)) and (`w_map_cell`.`distribution_no` = 696) and (`w_map_cell`.`ware_no` = 52))",
              "steps": [
                {
                  "transformation": "equality_propagation",
                  "resulting_condition": "((`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)) and multiple equal(0, `w_map_cell`.`yn`) and multiple equal(696, `w_map_cell`.`distribution_no`) and multiple equal(52, `w_map_cell`.`ware_no`))"
                },
                {
                  "transformation": "constant_propagation",
                  "resulting_condition": "((`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)) and multiple equal(0, `w_map_cell`.`yn`) and multiple equal(696, `w_map_cell`.`distribution_no`) and multiple equal(52, `w_map_cell`.`ware_no`))"
                },
                {
                  "transformation": "trivial_condition_removal",
                  "resulting_condition": "((`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)) and multiple equal(0, `w_map_cell`.`yn`) and multiple equal(696, `w_map_cell`.`distribution_no`) and multiple equal(52, `w_map_cell`.`ware_no`))"
                }
              ] /* steps */
            } /* condition_processing */
          },
          {
            "table_dependencies": [
              {
                "table": "`w_map_cell`",
                "row_may_be_null": false,
                "map_bit": 0,
                "depends_on_map_bits": [
                ] /* depends_on_map_bits */
              }
            ] /* table_dependencies */
          },
          {
            "ref_optimizer_key_uses": [
            ] /* ref_optimizer_key_uses */
          },
          {
            "rows_estimation": [
              {
                "table": "`w_map_cell`",
                "range_analysis": {
                  "table_scan": {
                    "rows": 3324,
                    "cost": 3990.8
                  } /* table_scan */,
                  "potential_range_indices": [
                    {
                      "index": "PRIMARY",
                      "usable": false,
                      "cause": "not_applicable"
                    },
                    {
                      "index": "idx_cellNo",
                      "usable": false,
                      "cause": "not_applicable"
                    },
                    {
                      "index": "uniq_shelfId_distributionNo_wareNo",
                      "usable": true,
                      "key_parts": [
                        "shelf_id",
                        "distribution_no",
                        "ware_no"
                      ] /* key_parts */
                    }
                  ] /* potential_range_indices */,
                  "setup_range_conditions": [
                  ] /* setup_range_conditions */,
                  "group_index_range": {
                    "chosen": false,
                    "cause": "not_group_by_or_distinct"
                  } /* group_index_range */,
                  "analyzing_range_alternatives": {
                    "range_scan_alternatives": [
                      {
                        "index": "uniq_shelfId_distributionNo_wareNo",
                        "ranges": [
                          "40001 <= shelf_id <= 40001 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40002 <= shelf_id <= 40002 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40003 <= shelf_id <= 40003 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40004 <= shelf_id <= 40004 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40005 <= shelf_id <= 40005 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40006 <= shelf_id <= 40006 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40007 <= shelf_id <= 40007 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40008 <= shelf_id <= 40008 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40009 <= shelf_id <= 40009 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40010 <= shelf_id <= 40010 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40011 <= shelf_id <= 40011 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40012 <= shelf_id <= 40012 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40013 <= shelf_id <= 40013 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40014 <= shelf_id <= 40014 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40015 <= shelf_id <= 40015 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40016 <= shelf_id <= 40016 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40017 <= shelf_id <= 40017 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40018 <= shelf_id <= 40018 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40019 <= shelf_id <= 40019 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40020 <= shelf_id <= 40020 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40021 <= shelf_id <= 40021 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40022 <= shelf_id <= 40022 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40023 <= shelf_id <= 40023 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40024 <= shelf_id <= 40024 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40025 <= shelf_id <= 40025 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40026 <= shelf_id <= 40026 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40027 <= shelf_id <= 40027 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40028 <= shelf_id <= 40028 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40029 <= shelf_id <= 40029 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40030 <= shelf_id <= 40030 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40031 <= shelf_id <= 40031 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40032 <= shelf_id <= 40032 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40033 <= shelf_id <= 40033 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40034 <= shelf_id <= 40034 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40035 <= shelf_id <= 40035 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40036 <= shelf_id <= 40036 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40037 <= shelf_id <= 40037 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40038 <= shelf_id <= 40038 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40039 <= shelf_id <= 40039 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                          "40040 <= shelf_id <= 40040 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52"
                        ] /* ranges */,
                        "index_dives_for_eq_ranges": false,
                        "rowid_ordered": false,
                        "using_mrr": false,
                        "index_only": false,
                        "rows": 1680,
                        "cost": 2056,
                        "chosen": true
                      }
                    ] /* range_scan_alternatives */,
                    "analyzing_roworder_intersect": {
                      "usable": false,
                      "cause": "too_few_roworder_scans"
                    } /* analyzing_roworder_intersect */
                  } /* analyzing_range_alternatives */,
                  "chosen_range_access_summary": {
                    "range_access_plan": {
                      "type": "range_scan",
                      "index": "uniq_shelfId_distributionNo_wareNo",
                      "rows": 1680,
                      "ranges": [
                        "40001 <= shelf_id <= 40001 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40002 <= shelf_id <= 40002 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40003 <= shelf_id <= 40003 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40004 <= shelf_id <= 40004 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40005 <= shelf_id <= 40005 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40006 <= shelf_id <= 40006 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40007 <= shelf_id <= 40007 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40008 <= shelf_id <= 40008 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40009 <= shelf_id <= 40009 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40010 <= shelf_id <= 40010 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40011 <= shelf_id <= 40011 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40012 <= shelf_id <= 40012 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40013 <= shelf_id <= 40013 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40014 <= shelf_id <= 40014 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40015 <= shelf_id <= 40015 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40016 <= shelf_id <= 40016 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40017 <= shelf_id <= 40017 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40018 <= shelf_id <= 40018 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40019 <= shelf_id <= 40019 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40020 <= shelf_id <= 40020 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40021 <= shelf_id <= 40021 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40022 <= shelf_id <= 40022 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40023 <= shelf_id <= 40023 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40024 <= shelf_id <= 40024 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40025 <= shelf_id <= 40025 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40026 <= shelf_id <= 40026 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40027 <= shelf_id <= 40027 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40028 <= shelf_id <= 40028 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40029 <= shelf_id <= 40029 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40030 <= shelf_id <= 40030 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40031 <= shelf_id <= 40031 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40032 <= shelf_id <= 40032 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40033 <= shelf_id <= 40033 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40034 <= shelf_id <= 40034 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40035 <= shelf_id <= 40035 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40036 <= shelf_id <= 40036 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40037 <= shelf_id <= 40037 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40038 <= shelf_id <= 40038 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40039 <= shelf_id <= 40039 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52",
                        "40040 <= shelf_id <= 40040 AND 696 <= distribution_no <= 696 AND 52 <= ware_no <= 52"
                      ] /* ranges */
                    } /* range_access_plan */,
                    "rows_for_plan": 1680,
                    "cost_for_plan": 2056,
                    "chosen": true
                  } /* chosen_range_access_summary */
                } /* range_analysis */
              }
            ] /* rows_estimation */
          },
          {
            "considered_execution_plans": [
              {
                "plan_prefix": [
                ] /* plan_prefix */,
                "table": "`w_map_cell`",
                "best_access_path": {
                  "considered_access_paths": [
                    {
                      "access_type": "range",
                      "rows": 1680,
                      "cost": 2392,
                      "chosen": true
                    }
                  ] /* considered_access_paths */
                } /* best_access_path */,
                "cost_for_plan": 2392,
                "rows_for_plan": 1680,
                "chosen": true
              }
            ] /* considered_execution_plans */
          },
          {
            "attaching_conditions_to_tables": {
              "original_condition": "((`w_map_cell`.`ware_no` = 52) and (`w_map_cell`.`distribution_no` = 696) and (`w_map_cell`.`yn` = 0) and (`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)))",
              "attached_conditions_computation": [
                {
                  "table": "`w_map_cell`",
                  "rechecking_index_usage": {
                    "recheck_reason": "low_limit",
                    "limit": 200,
                    "row_estimate": 1680
                  } /* rechecking_index_usage */
                }
              ] /* attached_conditions_computation */,
              "attached_conditions_summary": [
                {
                  "table": "`w_map_cell`",
                  "attached": "((`w_map_cell`.`ware_no` = 52) and (`w_map_cell`.`distribution_no` = 696) and (`w_map_cell`.`yn` = 0) and (`w_map_cell`.`shelf_id` in (40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040)))"
                }
              ] /* attached_conditions_summary */
            } /* attaching_conditions_to_tables */
          },
          {
            "refine_plan": [
              {
                "table": "`w_map_cell`",
                "access_type": "range"
              }
            ] /* refine_plan */
          }
        ] /* steps */
      } /* join_optimization */
    },
    {
      "join_execution": {
        "select#": 1,
        "steps": [
        ] /* steps */
      } /* join_execution */
    }
  ] /* steps */
}

标签:COMMENT,map,optimizer,trace,no,DEFAULT,cell,exlpain,id
From: https://www.cnblogs.com/zhengbiyu/p/17985444

相关文章

  • oceanbase中的trace_id如何转换为地址信息
    日常运维过程中,我们经常会使用OceanBase的trace_id来定位问题,trace_id是唯一表示SQL执行语句的,如果我们知道trace_id如何转换为地址,我们就知道了该SQL在哪个节点上执行的。下面来演示如何通过trace_id来获取地址信息以及端口 lixingdeMacBook-Pro:c_languagelihanghang$sh......
  • 【一文秒懂】Ftrace系统调试工具使用终极指南
    【一文秒懂】Ftrace系统调试工具使用终极指南1、Ftrace是什么Ftrace是FunctionTrace的简写,由StevenRostedt开发的,从2008年发布的内核2.6.27中开始就内置了。Ftrace是一个系统内部提供的追踪工具,旨在帮助内核设计和开发人员去追踪系统内部的函数调用流程。随着Ftrace的......
  • 使用strace将重定向一个已经运行进程的输出
    在Linux上,可以使用以下命令来重定向一个已经运行的进程的输出:首先,找到要重定向输出的进程的PID(进程号)。可以使用命令 ps 或 top 来查看正在运行的进程和它们的PID。使用命令 strace-pPID-s100-ewrite 来跟踪进程的输出。这将列出进程在标准输出上写入的内容......
  • tensorflow-gpu error:CUDNN_STATUS_ALLOC_FAILED或者self._traceback = tf_stack.extr
    tensorflow-gpuerror:CUDNN_STATUS_ALLOC_FAILED或者self._traceback=tf_stack.extract_stack() 在有些情况下,因为深度学习框架版本更新,细节的变动会使我们的代码最初对应修改:报错信息(出现其中一种):1.Couldnotcreatecudnnhandle:CUDNN_STATUS_ALLOC_FAILED2.self._trac......
  • go tool trace 跟踪执行过程,程序优化过程
    Go并发优化的9大技巧,效果立竿见影原创 Go先锋 Go先锋 2023-11-1008:02 发表于广东 听全文Go先锋读完需要8分钟速读仅需3分钟  概述Go语言以其在并发编程方面的优势而闻名,但合理利用各种优化技巧可以进一步提升Go程序的并发性能。本文将介绍在CP......
  • 在 SpringBoot 项目中使用 MDC 实现日志 traceId 的统一
    前言在项目中,对于每一次请求,我们都需要一个traceId将整个请求链路串联起来,这样就会很方便我们根据日志排查问题。但是如果每次打印日志都需要手动传递traceId参数,也会很麻烦,MDC就是为了解决这个场景而使用的。注:这里我们使用slf4j+logbacklogback配置logback.xml......
  • tkinter 将traceback展示出来
    在Tkinter中,您可以使用`messagebox`模块来显示错误消息和traceback。以下是一个示例¹:```pythonimporttkinter.messageboxastmimporttracebacktry:  1/0exceptExceptionaserror:  tm.showerror(title="Error",message="Anerrorhasoccurred:'"+str(e......
  • Encountered fatal error while reloading routing: Routing trace file does not mat
      efinity编译在routersetup时候报错Encounteredfatalerrorwhilereloadingrouting:Routingtracefiledoesnotmatchnetlist(netlistnetcount24888v.tracenetcount0).  解决方案:检查客户工程的PNR页面。beneficialskew页面是否打开,如果是on状态,试......
  • Hardhat框架使用及生成交易trace
    Hardhat介绍hardhat-tutorial安装Hardhat框架安装nvmbrewinstallnvm~/.zshrc添加nvm配置#NVMCONFIGexportNVM_DIR="$HOME/.nvm" [-s"/usr/local/opt/nvm/nvm.sh"]&&\."/usr/local/opt/nvm/nvm.sh"#Thisloadsnvm [-s"/us......
  • Remove TraceParent header from HttpClient requests
    ASP.NETCorecreatesanActivitythatrepresentstherequestbydefault.ThisiswhattellsHttpClienttosendanoutgoingrequestidheader.Youcandisableitinacoupleofways:Bysettingthecurrentactivitytonullbeforemakingtherequest(Activi......