小编Dus*_*wal的帖子

InnoDB:由于缺少 MLOG_CHECKPOINT 而忽略重做日志

我正在使用 mysql 版本 5.7.14(在 OS X El Capitan 上安装自制软件)。我的系统在 mysql 运行时没有正确关闭,重新启动后,当我尝试启动 mysql 守护程序时,我收到以下错误。

2017-02-07T10:11:42.224506Z 0 [Note] mysqld (mysqld 5.7.14) starting as process 18234 ...
2017-02-07T10:11:42.227375Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2017-02-07T10:11:42.228809Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-07T10:11:42.228821Z 0 [Note] InnoDB: Uses event mutexes
2017-02-07T10:11:42.228826Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-02-07T10:11:42.228830Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-02-07T10:11:42.229114Z 0 [Note] InnoDB: …
Run Code Online (Sandbox Code Playgroud)

mysql innodb mysql-5.7

13
推荐指数
1
解决办法
2万
查看次数

未使用时间戳列上的 Postgres 索引

我有一个数据库,其中有一列名为timestamptype timestamp without timezone,该列上有一个 btree 索引。

我有一个查询如下

SELECT
   *
FROM
  employee 
WHERE 
  timestamp >= timestamp '2020-01-27 13:24:09'
Run Code Online (Sandbox Code Playgroud)

timestamp但是,解释分析显示未使用该列上的索引:

Seq Scan on employee  (cost=0.00..5498.73 rows=34377 width=381) (actual time=0.016..37.944 rows=34251 loops=1)
   Filter: ("timestamp" >= '2020-01-27 13:24:09'::timestamp without time zone)
   Rows Removed by Filter: 21167
 Planning Time: 0.255 ms
 Execution Time: 40.277 ms
Run Code Online (Sandbox Code Playgroud)

如果我使用包含时间戳的过滤条件更改查询,而不是1 month1 year如上所述),则使用列上的索引。

Bitmap Heap Scan on employee  (cost=59.51..4510.25 rows=2996 width=381) (actual time=2.164..5.204 rows=2958 loops=1)
   Recheck Cond: ("timestamp" >= '2020-12-27 13:24:09'::timestamp without …
Run Code Online (Sandbox Code Playgroud)

postgresql index index-tuning postgresql-performance

5
推荐指数
0
解决办法
2609
查看次数