Questions tagged [multi-thread]

29 questions
9
votes
4 answers

How to get response from stored procedure before it finishes?

I need to return partial result (as simple select) from a Stored procedure before it is finished. Is it possible to do that? If yes, how to do that? If not, any workaround? EDIT: I have several parts of the procedure. In the first part I calculate…
5
votes
2 answers

Identity Column in Concurrency, Multithreading, Parallel Processing

Our company would like to understand the effects: If we have single table with Primary Key Identity column, int primary key IDENTITY(1,1), and the Application is conducting multi-threading parallel processing, trying to conducts 1000s of…
user129291
4
votes
3 answers

Identify threads with maximum difference in time

I have many parallel executing queries in my SQL Server database. I need to find out queries where the difference in time for the longest thread and the shortest thread is high (excluding co-ordinator thread). In fact, I need to find top 10 such…
3
votes
1 answer

SQL Server Threads and Degree Of Parallelism

My understanding about SQL Server threads is that SQL Server breaks down an execution request within a session into several tasks and associates each task with a worker thread. So SQL Server always tries to use multiple threads (if available and…
user99201
3
votes
1 answer

MySQL, many writes waiting on disk i/o access

I'm seeing a disk i/o problem with a MySQL DB under the following scenario: 24 CPU's total on the computer 22 threads writing simultaneously to separate tables each write is done using INSERT INTO ... VALUES ..., where there can be ~5000 rows being…
ivor
  • 31
  • 2
2
votes
2 answers

How to calculate the max number of worker threads in SQL Server?

I use 64-bit OS with two CPUs (each of them makes 7 logical processors) and with total number of logical processors equal to 14. When I run this code I get 2048 SELECT max_workers_count FROM sys.dm_os_sys_info On the other way, when I use the…
Rauf Asadov
  • 1,313
  • 14
  • 36
2
votes
0 answers

How get process that is locking Database on SQLite?

I'm developing a iOS app using SQLite. I've got a class to manage SQL's operations, basically read, write and update. In many cases I get a SQLITE_BUSY error, so I want know which process is using the database at the moment that the SQLITE_BUSY…
Augusto
  • 121
  • 4
2
votes
1 answer

UNION Queries run in Parallel form or not

I have three tables and I want to select data from these three tables in parallel form to increase the performance. I'm running a query like this. SELECT * FROM table1 UNION ALL SELECT * FROM table2 UNION ALL SELECT * FROM table3 I want to ask that…
Azeem Haider
  • 73
  • 1
  • 8
2
votes
6 answers

Run queries in parallel

I am running a sql script on mysql 5.7.18 ubuntu server 16.04 that does a large number of updates in one table. Each one of the 50k updates takes under a second but the total run time is very long (>20m). I can see from PROCESSLIST that only one…
rwms
  • 201
  • 1
  • 3
  • 10
2
votes
0 answers

MySQL queries waiting for other queries to finish

We have 30-40 different projects in Python and PHP that update, insert and select more than 1 million rows of data in MySQL DB every day. Currently we use InnoDB Engine for our tables. The problem: We have peaks in MySQL when almost all projects are…
Oleksandr
  • 21
  • 2
2
votes
1 answer

What does Oracle use for handling a client connection (process or thread)?

SQL Server 2016 and MySQL 5.7 use thread-based connection handling. PostgreSQL 9.5 uses one operating system process for each individual connection. According to Oracle 12c documentation it's not clear if a thread-based or a process-based model is…
Vlad Mihalcea
  • 917
  • 3
  • 9
  • 23
2
votes
1 answer

Can data streams from Informatica to SQL Server be multi-threaded?

Suppose we have a database server, with SQL Server on it. And we are moving data from another database server, through our Informatica server, and onto that SQL Server database server. And our SQL Server database server has four processors. Is it…
JustBeingHelpful
  • 2,116
  • 18
  • 45
  • 61
1
vote
0 answers

SqlServer User and IP address auditing using Triggers + SESSION_CONTEXT – is this thread safe?

Problem We use a combination of triggers and values set in SESSION_CONTEXT to implement dta change auditing on our SqlServer database. Unfortunately, we have started to notice that the username and Ip addresses are not always correct. It has become…
1
vote
1 answer

Race conditions. When 2 thread try to update in same entity in table

We all know that race condition is something we should avoid. We should not try to access the same variable or memory when using multiple threads. But I have some tricky cases. Let's say we have a user table. user id | name | age 1 | Paul |…
Jin Lim
  • 121
  • 1
  • 5
1
vote
2 answers

MySQL: Performance issues in heavy multi-threaded environment

I have 23 of these tables in one database: CREATE TABLE foo1 ( DateTime datetime NOT NULL, BidOpen decimal(11, 5) NOT NULL, BidHigh decimal(11, 5) NOT NULL, BidLow decimal(11, 5) NOT NULL, BidClose decimal(11, 5) NOT NULL, AskOpen…
Peter VARGA
  • 779
  • 1
  • 8
  • 16
1
2