pingcap / pingcap/tidb

Statistics of TIMESTAMP column is stored as datetime string without timezone information

Open
#52,429 5 comments 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
affects-6.1 affects-6.5 affects-7.1 affects-7.5 affects-8.1 component/statistics severity/moderate sig/planner type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

![image](https://github.com/pingcap/tidb/assets/7846227/0a66b662-2119-4a12-8a20-5cbc7df329f6)

As you can see, the type of this column is TIMESTAMP, but we store its histogram with datetime string without timezone information. And the timezone is not UTC, it's decided by the session executing the ANALYZE command.

This is not correct and will introduce an estimation error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.