小编chu*_*jiw的帖子

MySQL 服务器上非常简单的 AVG() 聚合查询需要非常长的时间

我正在通过 Amazon can service 使用 MySQL 服务器,使用默认设置。所涉及的表mytable属于InnoDB类型,大约有 10 亿行。查询是:

select count(*), avg(`01`) from mytable where `date` = "2017-11-01";
Run Code Online (Sandbox Code Playgroud)

这需要将近 10 分钟的时间来执行。我在 上有一个索引date。在EXPLAIN此查询的是:

+----+-------------+---------------+------+---------------+------+---------+-------+---------+-------+
| id | select_type | table         | type | possible_keys | key  | key_len | ref   | rows    | Extra |
+----+-------------+---------------+------+---------------+------+---------+-------+---------+-------+
|  1 | SIMPLE      | mytable       | ref  | date          | date | 3       | const | 1411576 | NULL  |
+----+-------------+---------------+------+---------------+------+---------+-------+---------+-------+
Run Code Online (Sandbox Code Playgroud)

该表中的索引是:

+---------------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table         | …
Run Code Online (Sandbox Code Playgroud)

mysql aggregation

3
推荐指数
1
解决办法
481
查看次数

Qt QSpinBox:如何显示大写的十六进制数

要使用 aQSpinBox来输入和显示十六进制数字,只需将其设置displayIntegerBase为 16。但是,我找不到将显示设置为大写的属性或方法(例如,1A而不是1a)。

我知道我可以覆盖textFromValue()方法来做到这一点,但感觉就像一个相当正常的用例。一定有更简单的方法来做到这一点,对吧?

我正在使用 Qt 5.12。

qt qspinbox qt5

3
推荐指数
1
解决办法
530
查看次数

此错误是否会带来不稳定的功能,使其无法与稳定的 Rust 版本一起使用?

我正在研究这个回购协议。它在 M2 笔记本电脑上的 MacOS 上构建没有问题;但是当我尝试在 Debian 桌面上构建它时,它显示以下错误:

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-1.0.37/src/lib.rs:238:34
    |
238 | #![cfg_attr(provide_any, feature(provide_any))]
    |                                  ^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `thiserror` due to previous error
Run Code Online (Sandbox Code Playgroud)

所以我尝试在 Debian 上使用 nightly build rustup default nightly,然后它就没有错误了。

我很困惑,因为这个错误是一个很受欢迎的错误。即使这个错误箱不能与稳定的 Rust 一起工作,但它确实具有不稳定的功能吗?这是否意味着大多数 Rust 开发人员使用夜间版本而不是稳定版本?

但为什么它在 Mac 上对我有效呢?我很确定我在 Mac 上有稳定版本。

一定有什么我错过了:) 提前谢谢你!

rust thiserror

3
推荐指数
1
解决办法
866
查看次数

标签 统计

aggregation ×1

mysql ×1

qspinbox ×1

qt ×1

qt5 ×1

rust ×1

thiserror ×1