如何在以下方案中提高性能?

时间:2022-06-04 05:30:19

I have a Table, with certain number of columns, I have applied a certain algorithm and was able to divide the existing Table into 5 tables. Here is the image of the databases after the application of algorithm. 如何在以下方案中提高性能? So I have divided the stsi table into base, card_type, country, cvv, . The STSI had the following attributes .. id, name, phone, email, branch, country, ac_no, credit_card, card_type, cvv. So after the application of the algorithm, The base table has the id, name, email, branch, ac_no, credit_card, phone. And the remaining attributes are card_type, country and cvv. These attributes are given a separate table each. Let's say for the tale cvv. The attributes will be id and cvv. The id will be a primary_key to the base table. So as per the image I was able to reduce the number of rows in the newer tables formed since cvv has 7829 rows instead of 9000 as in STSI, because of the nulls in STSI. The performance was increased with respect to space. But I am unable to increase the time complexity.

我有一个表,有一定数量的列,我已经应用了一定的算法,并能够将现有的表分成5个表。这是应用算法后数据库的图像。所以我将stsi表分为base,card_type,country,cvv ,. STSI具有以下属性:id,name,phone,email,branch,country,ac_no,credit_card,card_type,cvv。因此在应用算法后,基表有id,name,email,branch,ac_no,credit_card,phone。剩下的属性是card_type,country和cvv。这些属性每个都有一个单独的表。让我们说故事cvv。属性将是id和cvv。 id将是基表的primary_key。因此,根据图像,我能够减少所形成的较新表中的行数,因为cvv具有7829行而不是STSI中的9000行,因为STSI中的空值。在空间方面,性能有所提高。但我无法增加时间复杂度。

I intended that newer tables should have lesser time complexity, as they have relatively lesser number of rows. But I am not able to get any performance increase. I have tried indexing, but it did not result in any performance gain. what can I possibly do for increase in performance with respect to time, when executed on new tables.

我打算让较新的表格具有较小的时间复杂度,因为它们的行数相对较少。但我无法获得任何性能提升。我尝试过索引,但它没有带来任何性能提升。当在新表上执行时,我可以做些什么来提高性能。

ps: The queries are
select id,cvv from stsi - 0.0005 seconds select id,cvv from cvv - 0.0005 seconds
I am hoping that second query should take lesser time!

ps:查询是选择id,来自stsi的cvv - 0.0005秒选择id,来自cvv的cvv - 0.0005秒我希望第二个查询应该花费更少的时间!

1 个解决方案

#1


5  

At 0.5ms, its likely the limiter is actual system response time (disk read, CPU processing, etc) and not the query itself. No amount of optimization is going to reduce that response time.

在0.5ms时,限制器可能是实际系统响应时间(磁盘读取,CPU处理等)而不是查询本身。没有多少优化会缩短响应时间。

As a general rule, when you are looking at simple select queries (select val1, val2 from table), the biggest driver of performance is going to be the underlying system configuration (disk configuration and memory availability mainly) and database design.

作为一般规则,当您查看简单的选择查询(从表中选择val1,val2)时,性能的最大驱动因素将是底层系统配置(主要是磁盘配置和内存可用性)和数据库设计。

Using good indexing can help query response time by reducing the amount of data that has to be read to produce results. In the above example, placing an index on the CCV table consisting of ID and CCV would likely yield a faster response as your dataset grows.

使用良好的索引可以通过减少必须读取以产生结果的数据量来帮助查询响应时间。在上面的示例中,在包含ID和CCV的CCV表上放置索引可能会随着数据集的增长而产生更快的响应。

I assume, based on your bolding, that your question stems of the fact that STSI has more rows than CCV and you expected CCV to be faster. The reality is that you are likely seeing the first constraint here (system configuration) and not database design.

我假设,基于你的粗体,你的问题源于STSI有比CCV更多的行,你期望CCV更快。实际情况是,您可能会看到第一个约束(系统配置)而不是数据库设计。

Half a millisecond is damn fast. I dont know that you should expect to see anything faster on consumer grade hardware even if you were comparing a 9000 row table to a 9 row table.

半毫秒快死了。我不知道你应该期望在消费级硬件上看到更快的东西,即使你将9000行表与9行表进行比较。

#1


5  

At 0.5ms, its likely the limiter is actual system response time (disk read, CPU processing, etc) and not the query itself. No amount of optimization is going to reduce that response time.

在0.5ms时,限制器可能是实际系统响应时间(磁盘读取,CPU处理等)而不是查询本身。没有多少优化会缩短响应时间。

As a general rule, when you are looking at simple select queries (select val1, val2 from table), the biggest driver of performance is going to be the underlying system configuration (disk configuration and memory availability mainly) and database design.

作为一般规则,当您查看简单的选择查询(从表中选择val1,val2)时,性能的最大驱动因素将是底层系统配置(主要是磁盘配置和内存可用性)和数据库设计。

Using good indexing can help query response time by reducing the amount of data that has to be read to produce results. In the above example, placing an index on the CCV table consisting of ID and CCV would likely yield a faster response as your dataset grows.

使用良好的索引可以通过减少必须读取以产生结果的数据量来帮助查询响应时间。在上面的示例中,在包含ID和CCV的CCV表上放置索引可能会随着数据集的增长而产生更快的响应。

I assume, based on your bolding, that your question stems of the fact that STSI has more rows than CCV and you expected CCV to be faster. The reality is that you are likely seeing the first constraint here (system configuration) and not database design.

我假设,基于你的粗体,你的问题源于STSI有比CCV更多的行,你期望CCV更快。实际情况是,您可能会看到第一个约束(系统配置)而不是数据库设计。

Half a millisecond is damn fast. I dont know that you should expect to see anything faster on consumer grade hardware even if you were comparing a 9000 row table to a 9 row table.

半毫秒快死了。我不知道你应该期望在消费级硬件上看到更快的东西,即使你将9000行表与9行表进行比较。