database-performance

Fastest way to compute for hash of a whole table [duplicate]

夙愿已清 提交于 2021-02-07 06:20:08
问题 This question already has an answer here : Oracle get checksum value for a data chunk defined by a select clause (1 answer) Closed 2 years ago . We need to be able to compute table hashes for an external environment and compare it to pre-computed hash from an internal environment. The use of this is to ensure that data in the external environment is not tampered by a "rogue" database administrator. Users insist this feature . Currently, we do this by computing the individual hashes of each

Performance difference between table collations in MySQL

时间秒杀一切 提交于 2021-01-28 10:10:19
问题 I know that having a different column collation impacts table performance, but I haven't been able to find any information on performance difference between table collations. Also, what if I don't have any varchar/etc. type columns in my table, in that case does it even matter what collation is my table set to? If so what's the most robust collation to have for a table that contains only number column types? 回答1: The table character set and collation are used as default values for column

Cassandra nodetool cfstats - Read Count is always 0

不羁岁月 提交于 2021-01-28 04:09:31
问题 I've got a problem with monitoring my Cassandra node. I ran nodetool cfstats keyspaceName.tableName Unfortunately Read Count is always 0 and Read Latency is NaN. I am doing reads and writes but only writes metrics are updated. Here is what I got as an output: Starting NodeTool Keyspace: realtimetrader Read Count: 0 Read Latency: NaN ms. Write Count: 402 Write Latency: 0.09648756218905473 ms. Pending Flushes: 0 Table: currencies SSTable count: 1 Space used (live): 5254 Space used (total): 5254

Why did changing from utf8 to utf8mb4 slow down my database?

你说的曾经没有我的故事 提交于 2021-01-02 08:23:40
问题 All the MySQL tables in my PHP web application are MyISAM with utf8 encoding. Since records can be generated from a companion app while it's offline, my table keys are randomly generated, alphanumeric VARCHARs; these fields are set to binary with utf8_bin encoding so they can be case-sensitive. I recently decided to change the encoding of all my text fields, to support emojis that some users like to enter. I went ahead and changed all utf8 fields to utf8mb4, including the keys. I immediately

Why did changing from utf8 to utf8mb4 slow down my database?

二次信任 提交于 2021-01-02 08:23:29
问题 All the MySQL tables in my PHP web application are MyISAM with utf8 encoding. Since records can be generated from a companion app while it's offline, my table keys are randomly generated, alphanumeric VARCHARs; these fields are set to binary with utf8_bin encoding so they can be case-sensitive. I recently decided to change the encoding of all my text fields, to support emojis that some users like to enter. I went ahead and changed all utf8 fields to utf8mb4, including the keys. I immediately

Query cost: Global Temporary Tables vs. Collections (Virtual Arrays)

最后都变了- 提交于 2020-07-16 07:01:36
问题 I have a query whose results are stored in a GTT (Global Temporary Table) and in a Collection. Selecting the data from the GTT again, I get a very small cost: 103. SELECT ... FROM my_table_gtt JOIN table2 ... JOIN table3 ... But when switching this from a GTT to a Collection (VA - Virtual Array), the cost skyrockets (78.000), but the difference in execution times between the two is very small. SELECT ... FROM TABLE(CAST(my_table_va as my_table_tt)) JOIN table2 ... JOIN table3 ... My question

What is the best practice to save a quiz answers with different data types in MYSQL?

一曲冷凌霜 提交于 2020-03-28 06:41:04
问题 UPDATE: part 1- start: We want to get our customers data, but which kind of data? they are not specified! actually we want to have a dynamic application that the admin can define new questions (he can set the answer's data type, length, and other rules) and he also can deactivate old questions! (I don't want to use EAV schema design, but I can't find the alternative way) UPDATE: part 1 - end: so I decided to create a quiz application, admin can define questions which their answers data type

What is the best practice to save a quiz answers with different data types in MYSQL?

家住魔仙堡 提交于 2020-03-28 06:40:19
问题 UPDATE: part 1- start: We want to get our customers data, but which kind of data? they are not specified! actually we want to have a dynamic application that the admin can define new questions (he can set the answer's data type, length, and other rules) and he also can deactivate old questions! (I don't want to use EAV schema design, but I can't find the alternative way) UPDATE: part 1 - end: so I decided to create a quiz application, admin can define questions which their answers data type

How to speed up a Cosmos DB aggregate query?

偶尔善良 提交于 2020-02-02 02:30:08
问题 Our cosmos db aggregate query seems slow and costs a lot of RUs. Here are the details (plus see screenshot below): 2.4s and 3222RUs to count a result set of 414k records. Also this for just one count. Normally we would want to do a sum on many fields at once (possible only within a single partition), but performance for that is much worse. There are 2 million records in this collection. We are using Cosmos DB w/SQL API. This particular collection is partitioned by country_code and there are