Questions tagged [tidb]

TiDB is an open-source distributed SQL database that supports Hybrid Transactional and Analytical Processing (HTAP) workloads. It's MySQL compatible and features horizontal scalability, strong consistency, and high availability.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

How to work around TiCDC atomic transactional limitations?

I'm learning about TiCDC. As I read the documentation, it seems that TiCDC basically replicates changes in each key-value pair rather than the unit of transaction (which may include multiple key-value ...
Tetsuya3850's user avatar
0 votes
3 answers
70 views

Error P1001: Unable to reach database server when following Prisma's Start from Scratch guide for relational databases with Node.js and MySQL

I am trying to follow Prisma's Start from Scratch guide for setting up a relational database with Node.js and MySQL. However, I encountered an error and I cannot connect to the database server. Here ...
Tabris's user avatar
  • 1
0 votes
1 answer
33 views

How does the tide-operator start a pd cluster?

I've recently been learning about Kubernetes operators. When deploying an etcd cluster, the etcd-operator uses the following creation method: Bootstrap phase: Start a seed member. In the ...
Phoenix Chao's user avatar
0 votes
2 answers
26 views

Does TiDB's range based sharding nature have actual read workload benefits?

I understand that TiDB, compared to DynamoDB, chose range-based sharding rather than hash-based sharding. Now, one explanation I learned is that by using range-based sharding, you can do where ...
Tetsuya3850's user avatar
0 votes
2 answers
45 views

In TiDB how do you work around the issue where even for indexes, you can't write continuous values to avoid hotspots?

In TiDB, due to its range scan-based sharded nature, I understand that you should avoid writing continuous values. For primary keys, a standard solution is to use auto random rather than auto ...
Tetsuya3850's user avatar
0 votes
1 answer
23 views

In TiDB, how to use snowflake style uuid without causing hot spot by doing bit reverse?

In this docs, https://docs.pingcap.com/tidb/stable/dev-guide-unique-serial-number-generation It says "Finally, note that the IDs generated by the above two solutions are not random enough to be ...
Tetsuya3850's user avatar
0 votes
1 answer
25 views

For TiDB, does incremental value in secondary index cause hotspots too?

I want to ask about TiDB index design. It is noted in the docs that using auto-increment will cause a hotspot in the write since range-based sharding is used. Is this the same case for secondary ...
Tetsuya3850's user avatar
1 vote
1 answer
97 views

How to support "FULL JOIN" clause

I'm trying to add "FULL JOIN" support in TiDB parser(https://github.com/pingcap/tidb/tree/master/parser). I tried two different modifications to parser.y. In attempt one: I changed the ...
xiaonerner0821's user avatar
-1 votes
1 answer
40 views

How to drop a table, the name with ‘\t’ in tidb?

This question is originally asked by 'xyz2b' in https://ask.pingcap.com/t/how-to-drop-a-table-the-name-with-t/669 I created two tables one of which contains ‘\t’. I want to drop the table with ‘\t’. ...
Wink Yao's user avatar
0 votes
1 answer
46 views

[BR:Stream:ErrStreamLogTaskExist]stream task already exists

I deployed TiDB in public cloud kubernetes cluster. Everything is okay and running as expected. But when I try to do backup to S3 using BR with log method. docs. After that, I want to terminate the ...
Derhoer IT's user avatar
0 votes
2 answers
38 views

Increased replication in TiKV cluster, but storage use did not increase after applying

I am running a TiKV v7.2.0 cluster, which was deployed with tiup with server_configs.pd.replication.max-replicas: 1 configured in topology. After storing about 8TB of data in the cluster, I edited ...
Mike B's user avatar
  • 1
0 votes
1 answer
44 views

tidb-lightning.toml got permission denied in WSL

I tried to upload my SQL files to TiDB Cluster via tidb-lightning.toml, and here is the result of my nohup.out: tiup is checking updates for component tidb-lightning ... Starting component `tidb-...
Darryl RN's user avatar
  • 7,675
0 votes
1 answer
222 views

TiDB executing full table scan

I am using TiDB version 6.5.1, I wanted to know the behavior of TiKV, let's say I have a table t which contains composite index example (a,b), when I am trying to execute following cases, 1.select sum(...
Ajay's user avatar
  • 47
0 votes
1 answer
171 views

TiKV is sufficient for both OLTP and OLAP workloads?

I have an requirement to maintain big data sets in a single database and it should support both OLTP & OLAP workloads, I saw TiDB it will support HTAP workloads but we need to maintain data in ...
Ajay's user avatar
  • 47
0 votes
1 answer
106 views

SELECT query on TiDB/TiFlash fails with ERROR 1105 (HY000) when running against a replicated table

We run a TiDB cluster consisting of twelve nodes. The TiDB version is 6.5.0. We have recently added a TiFlash node in order to enable HTAP/analytics processing. Replicating a table appears to work ...
junglerider's user avatar
0 votes
2 answers
111 views

How to execute the same SELECT statement for every element in a set, and union the results?

In TiDB, how can I execute the same SELECT statement for every element of a set and union the results? E.g. suppose I have this query which takes given_id and returns <= 3 ids: SELECT id FROM ...
emchristiansen's user avatar
0 votes
1 answer
50 views

TiDB as metastore for hive

Is somebody using TiDB as metastore for hive installation? Looking for experience and testimonials as we are evaluating it to solve our current metastore bottleneck while using mysql.
Shakti Garg's user avatar
-1 votes
2 answers
68 views

How to convert SQL query to key-value command

Is it possible to use some opensource project to help parse the sql query and convert it into the custom key-value db command (CRUD on the key). I saw the architecture of the tidb, and it seems like ...
harpy's user avatar
  • 1
0 votes
2 answers
289 views

Create a tidb database on docker compose

I have a docker-compose.yml file with the tidb container setup like this ti-db: image: pingcap/tidb container_name: ti-db ports: - 4000:4000 logging: driver: none ...
NoncomissionedRush's user avatar
1 vote
3 answers
112 views

What is the proper way to find the connection ID by the requested query statement in TiDB?

Im creating an alter automation script that executes an alter on the TiDB cluster. In case of an error, I need to kill the running alter using the KILL statement - https://docs.pingcap.com/tidb/stable/...
Andy Marrel's user avatar
0 votes
1 answer
232 views

how to remove ghost peers from a failed TiDB scale-in operation

I scaled in a TiDB cluster a few weeks ago to remove a misbehaving TiKV peer. The peer refused to tombstone even after a full week so I turned the server itself off, left a few days to see if there ...
Kae Verens's user avatar
  • 4,086
1 vote
1 answer
136 views

What are the semantics of not using "FTWL to guarantee that the dump file is consistent with metadata"?

When migrating data from AWS RDS MySQL to TiDB using DM we got the following error: Couldn't acquire global lock, snapshots will not be consistent: Access denied for user 'root'@'%' (using password: ...
merlin2011's user avatar
  • 72.3k
0 votes
1 answer
101 views

tidb cannot fuzzy query with like '_' for double byte character?

In my program, I want to lookup "测试" with select * from test where name like '测_'; After my test, I found that MySQL can, but tidb can't?
I'm ziyou a's user avatar
0 votes
0 answers
172 views

Migrate ENUM columns from mysql to TiDB

I met a problem when migrate data ( by TiDB DM) from mysql I have a table in mysql which have a enum columns: `xxx` enum('offer','payment') NOT NULL DEFAULT 'offer', I create a migration task, the ...
Quyen Le's user avatar
0 votes
1 answer
101 views

TiDB single drainer architecture is creating a single point of failure

We’re trying to create Master-Master replication between two TiDB clusters. Each cluster has 3 PD server, 4 KV servers and 2 TiDB server. TiDB is running with binlog enabled. On TiDB servers we have ...
Erik Feigin's user avatar
1 vote
1 answer
188 views

How can I set memory capacity of each TIKV?

How can I set the capacity of a TIKV instance? Lets say I have 2 TIKV instances and I want them to consume 200GB of storage (each 100GB).
Elnur's user avatar
  • 119
0 votes
1 answer
228 views

What different betweent optimistic and pessimistic in tikv?

When I use tikv api, and I found it has an option in TxnKV client, then I test it, but I can not find what the difference between optimistic and pessimistic is in tikv? The test code is this: func ...
Jiangjiang Xu's user avatar
-2 votes
1 answer
118 views

what dose lockkeys in tikv api use for?

Recently, I was looking at tikv's api document. There is a LockKey api in transaction. When I call it for operation, I directly panic. i have serval question? i want to know why it panic what does ...
Jiangjiang Xu's user avatar
0 votes
1 answer
167 views

TiDB indexes are not getting used for queries

I'm using mysql connector to connect with TiDB. I have found that indexes are not getting used in my queries. After my analysis i have found that due to casting indexes were not used. E.g CREATE TABLE ...
suresh rajput's user avatar
0 votes
1 answer
155 views

Getting Readiness problem failed due to connection refused in tidb pods only in tidb cluster

We have been running tidb cluster in k8s. and its working fine since. But suddenly i am getting following issue only in new statsfull pods tidb-tidb-1 after scaling tidb-tidb statsfulset. ...
Taybur Rahman's user avatar
0 votes
0 answers
201 views

TiDB load balancing not working via MYSQL connector c# .net core

I have setup TiDB for my .net core app. I'm connecting TiDB with the MYSQL connector in the .net core app. Below is my connection string server=server1,server2,server3;Port=4000;UID=test_user;PWD=****;...
suresh rajput's user avatar
0 votes
1 answer
105 views

What are the effects of rolling updates TiDB?

What are the effects of rolling updates TiDB? If it will impact production env? When do the TiKV leader's transfer to other TiKV, how much time it will take? I have tried to find from PingCAP ...
yi888long's user avatar
0 votes
1 answer
173 views

Flink: binlog transformation to multiple DTO and transformation method in flink

A newer to Kafka, Flink and Tidb. Assume I have three source MySql tables s_a, s_b, and s_c, and want to collect records to target TiDb table t_a and t_b in a realtime. The mapping rules are `s_a` --&...
shijie xu's user avatar
  • 2,005
0 votes
1 answer
197 views

Why does query become very slow with multiple indexes even I don't use it

I am using TiDB to do some testing. I created a table as below CREATE TABLE users( id BIGINT PRIMARY KEY NOT NULL, updated BIGINT NOT NULL ) I loaded around 100,000,000 rows into this table with 2 ...
TzuLin Chin's user avatar
0 votes
1 answer
99 views

How to set tidb global system variables in filesystem

Can global system variables (eg: https://docs.pingcap.com/tidb/stable/system-variables) be set on the filesystem (eg: tidb.toml) before startup or can they only be set via a client? eg: set @@global....
Jeremy Norris's user avatar
-2 votes
1 answer
391 views

Are there any ways to set specified default username and password in TiDB docker-compose file?

Based on TiDB official docker compose article, it sets default username/password to root/"" https://docs.pingcap.com/zh/tidb/v3.0/deploy-test-cluster-using-docker-compose Does anyone know ...
Jimmy Chien's user avatar
0 votes
2 answers
247 views

How to modify tidb default GLOBAL variables like "tidb_replica_read" value in TiDB

Concept: https://pingcap.com/docs/dev/follower-read/ For detailing, i have also asked the question in here: https://github.com/pingcap/tidb/issues/17650 While getting value of tidb_replica_read ...
rachitmanit's user avatar
1 vote
1 answer
441 views

how to optimize count(*)queries on tidb

I have a table with about 3000000 rows described as below. Field |Type |Null|Key|Default|Extra | ------------------|------------|----|---|-------|--------------| id ...
rshetye's user avatar
  • 667
0 votes
2 answers
1k views

PySpark JDBC Write to MySQL (TiDB)

I am trying to write a pyspark dataframe (Millions of row) to TIDB, (Spark 2.3) df.write.format('jdbc').options( url='jdbc:mysql://<host>:<port>/<table>', driver='com.mysql.jdbc....
Hardik Gupta's user avatar
  • 4,720
0 votes
1 answer
242 views

tidb-ansible error in ansible-playbook bootstrap.yml command

I am trying to install TiDB through TiDB ansible. I am referring to documentation in https://pingcap.com/docs/v1.0/op-guide/ansible-deployment/ and in the process I am facing the following error for ...
pragathi narendra's user avatar
0 votes
1 answer
347 views

TiDB-ansible installation - ansible-playbook local_prepare.yml command failure

I am trying to install tidb on a single node using tidb ansible. I have set up the right IP address for PD, TiDB and TiKV server in inventory.ini file. I am following the instructions in https://...
pragathi narendra's user avatar
1 vote
1 answer
118 views

Is PD component has any authentication method to limit databases that Spark can access?

Is PD have any authentication method to limit databases Spark can access? because if someone know my PD address, they can use TiSark to connect to TiDB and query on my databases. I have setup a TiDB ...
Thorn Honor's user avatar
0 votes
1 answer
96 views

java.io.InvalidClassException: com.pingcap.tikv.region.TiRegion - Local class incompatible

I want to connect my Spark cluster to TIDB by TiSpark but I got a problem when I run my Spark application, an error occur: java.io.InvalidClassException: com.pingcap.tikv.region.TiRegion; local ...
Thorn Honor's user avatar
0 votes
0 answers
48 views

Why declare the same variables in Golang? [duplicate]

I found this code in the pingcap/parser: var ( _ DDLNode = &AlterTableStmt{} _ DDLNode = &CreateDatabaseStmt{} _ DDLNode = &CreateIndexStmt{} _ DDLNode = &...
anhnq's user avatar
  • 296
0 votes
1 answer
146 views

Dropped rows in Spark when modifying database in MySQL

I've been following the 5 min how to for setting up an htap databse with tidb_tispark and everything works until I get to the section Launch TiSpark. My first issue occurs when executing the line: ...
Bash's user avatar
  • 638
0 votes
1 answer
129 views

what's the difference and affect of set[sync-log=false]for tidb

In tidb ,when open sync-log ,disk io util can be over 90%,after set sync-log=false,it goes down to 1%,what's the bad effect of this config?
bowen zhang's user avatar
0 votes
2 answers
334 views

What is "mult-raft" in TiKV?

I came across this intersting database the other day, and have read some doc on its offical site, I have some questions regarding Raft Group in TiKV (here), Suppose that we have a cluster which has ...
gfytd's user avatar
  • 1,777
2 votes
1 answer
553 views

Why the TiDB performance drop for 10 times when the updated field value is random?

I set up the TiDB, TiKV and PD cluster in order to benchmark them with YCSB tool, connected by the MySQL driver. The cluster consists of 5 instances for each of TiDB, TiKV and PD. Each node run a ...
user1584887's user avatar
0 votes
1 answer
482 views

Can we run multiple TiDB instances connected to the same cluster to PD and (hence TiKV)?

I want to set up a local cluster of TiDB for the benchmark. Here are some my doubts: Can multiple TiDB instances connect to the same PD and TiKV cluster? (We only notice a single TiDB instance in ...
user1584887's user avatar
0 votes
1 answer
84 views

How to split horizontally table on multiple zones?

I want to split data on multiple tiKV because I have Swiss, Europeans and Americans and I need to store data in citizen country. The user’s table has a country code and automatically data are stored ...
Nicolas's user avatar