database-performance

Many Individual Queries v. One Big One

百般思念 提交于 2019-12-24 16:26:15
问题 I'm in a situation where an entire column in a table (used for user tokens) needs to be wiped, i.e., all user tokens are reset simultaneously. There are two ways of going about it: reset each user's token individually with a separate UPDATE query; or make one big query that affects all rows. The advantage of one big query is that it will obviously be much faster, but I'm worried about the implications of a large UPDATE query when the database is big. Will requests that occur during the query

Delete Large Number of Rows Is Very Slow - SQL Server

我是研究僧i 提交于 2019-12-24 15:22:06
问题 I have database table contains around 3 millions records. When I delete large number of rows, around 400,000 records, the transaction takes forever to finish. The table is not partitioned and the database is running on Sql Server 2012 Standard Edition. I'm using Nhibernate as ORM. How do I make the transaction faster? Here the creation script of the table /****** Object: Table [dbo].[ES_DirectorDataParameters] Script Date: 03/10/2016 4:10:30 PM ******/ SET ANSI_NULLS ON GO SET QUOTED

Is there any way to replace like condition in postgresql?

六月ゝ 毕业季﹏ 提交于 2019-12-24 15:05:03
问题 I am having the following query in my code. It takes a minute to get the data due to to the like condition. If you have any way to replace it or speed up the retrieve time, Please let me know. select id, url from activitylog where resource = 'jobs' and (method = 'saveTechStatus') and (url like '%/jobs/saveTechStatus/81924/%') order by timestamp desc; 回答1: You could use a trigram index: CREATE EXTENSION pg_trgm; CREATE INDEX ON activitylog USING gin (url gin_trgm_ops); This may take a lot of

MySQL server not fully utilized; threads_running is lesser than 2

亡梦爱人 提交于 2019-12-24 02:51:43
问题 I am running MySql 5.6 and I noticed that the CPU utilization never crosses 50% on an m1.large aws instance, when I benchmark the server (a few hundred queries executed in parallel over a period of time). I have set the thread_cache variable to 50 and max_connections 500. When I execute the following commands from shell, mysqladmin -u root -ppassword -r -i 1 ext | grep Threads_created I notice that Threads created never crosses 3 mysqladmin -u root -ppassword -r -i 1 ext | grep Threads

Specific postgresql server configuration for data analysis purposes

ε祈祈猫儿з 提交于 2019-12-23 19:35:09
问题 Is there any tips on tuning server's performance using postgresql.conf file in case you use a postgresql database specifically for data science department and data analysis purposes? Or performance tuning itself is purpose-agnostic and there is no real difference what you will do with it since 'it is all about extracting data'? It's a rather obscure question i didn't find an answer for (in miriads of articles on data science topic). 回答1: Though this is a very general question, I'll try my

Grails vs Spring [closed]

社会主义新天地 提交于 2019-12-23 10:53:04
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Can any one please explain me that whats the better option for an enterprise java web application of more than 500 database tables.Either we should use Grails or Go for (Spring,hibernate and Spring MVC/Struts 2).If you suggest grails then please elaborate why not the other

Removing a Primary Key (Clustered Index) to increase Insert performance

有些话、适合烂在心里 提交于 2019-12-23 10:47:09
问题 We've been experiencing SQL timeouts and have identified that bottleneck to be an audit table - all tables in our system contain insert, update and delete triggers which cause a new audit record. This means that the audit table is the largest and busiest table in the system. Yet data only goes in, and never comes out (under this system) so no select performance is required. Running a select top 10 returns recently insert records rather than the 'first' records. order by works, of course, but

Performance issue while inserting 2000 records using mybatis(3.2.8 version)

心不动则不痛 提交于 2019-12-23 05:11:34
问题 I am trying to insert 2000 records in Employee table in batch (using mybatis). My requirements are: 1. To log the error if any of the record fails to insert. 2. To continue with the insertion even if any one of the record fails. 3. Rollback should not happen for other if any one of the record fails. 4. Good performance. Sample code of Dao implementation: Here I have come up with 2 scenarios. Calling sqlSession.commit() outside the loop. SqlSession sqlSession = MyBatisUtil.getSqlSessionFactory

In clause versus OR clause performance wise

橙三吉。 提交于 2019-12-23 04:52:10
问题 I have a query as below: select * from table_1 where column_name in ('value1','value2','value3'); considering that the data in such a table may be in millions, will the below restructuring help better?? select * from table_1 where column_name = 'value1' or column_name = 'value2' or column_name ='value3'; or select * from table_1 where column_name = any ('value1','value2','value3'); I need to know performance benefits also if possible. Thanks in advance 回答1: the query doesn't matter much in

Load a large csv file into neo4j

久未见 提交于 2019-12-23 04:40:54
问题 I want to load a csv that contains relationships between Wikipedia categories rels.csv (4 million of relations between categories). I tried to modify the setting file by changing the following parameter values: dbms.memory.heap.initial_size=8G dbms.memory.heap.max_size=8G dbms.memory.pagecache.size=9G My query is as follows: USING PERIODIC COMMIT 10000 LOAD CSV FROM "https://github.com/jbarrasa/datasets/blob/master/wikipedia/data/rels.csv?raw=true" AS row MATCH (from:Category { catId: row[0]}