Tag Info

Hot answers tagged

11

It is mostly a license issue. These developments end up patching the code quite heavily, so if you were to deal with MySQL, you'd either have to open-source your code or be at the mercy of MySQL's corporate owner for the life of your business. Some offers for MySQL get around that by implementing their work as a storage engine, but that doesn't offer all ...


10

There is a lot of misunderstanding about CXPACKET. CXPACKET isn't the cause of your problems, it is a side effect. What CXPACKET means when you see it is that that thread of a parallel query is waiting for another thread of that query to do something. Just because you see a lot of CXPACKET waits doesn't mean there's a problem with the query, it means that ...


8

I can see two reasons: 1) historically, PostgreSQL had better query planner and statistics analyzer. This might be not true now, but few years ago PostgreSQL was much better then MySQL on complex queries, which is OLAP ones. 2) PostgreSQL have better functions/triggers/etc programming support.


8

Few months ago, I faced similar situation wherein the MAXDOP setting was default and a run away query exhausted all the worker threads. As Remus pointed out this is called worker thread starvation. There will be a memory dump created on your server when this condition occured. If you are on 2008R2+SP1 and up then sys.dm_server_memory_dumps will give you ...


7

No. Please see http://wiki.postgresql.org/wiki/FAQ " How does PostgreSQL use CPU resources? The PostgreSQL server is process-based (not threaded), and uses one operating system process per database session. A single database session (connection) cannot utilize more than one CPU. Of course, multiple sessions are automatically spread across all available CPUs ...


6

You're not seeing the benefits of parallel execution because both insert methods use single-row inserts, hence parallel does not kick in ! Parallel execution is only available for bulk operations. Lots of tiny operations doesn't qualify as a set operation. You're inserting rows one by one here, you should try it with a bulk operation (INSERT /*+APPEND*/ ...


6

You usually don't want to disable parallelism as that will also disable it for admin tasks. Your best bet is to fix the queries that are causing the parallelism through adding or fixing indexes or through making full on schema changes. Based on your updated questions... Some people will change MAXDOP to 1 for vendor built applications because they can't ...


6

You may find this surprising, but you should set the innodb_thread_concurrency to 0 (which is infinite concurrency). This will allow the InnoDB Storage Engine to decide how many concurrency tickets to issue. I wrote a post about InnoDB's multicore engagement (MySQL 5.5, also MySQL 5.1.38 InnoDB Plugin) back on May 26, 2011. According to the MySQL ...


6

It looks like it is probably following an index on CreatedDate in order from lowest to highest and doing lookups to evaluate the SomeIndexedValue = 1 predicate. When it finds the first matching row it is done, but it may well be doing many more lookups than it expects before it finds such a row (it assumes the rows matching the predicate are randomly ...


6

CXPACKET is never a cause; it gets all the blame, but it's always a symptom of something else. You need to catch these queries in the act and figure out what "something else" is. It might be different from query to query, and turning off parallelism altogether is - as you've suggested - unnecessary overkill in most cases. But it is often the least amount of ...


6

There could be several reasons. Most likely is that you were out of workers. See max_worker_threads. The condition is called 'worker stravation'. The workers could be stolen by any one of multiple means (none of which would result in high CPU utilization, btw), like having many requests blocked or doing stupid things in CLR (eg. HTTP requests). The symptom ...


5

I wrote about six potential issues with parallelism here: http://sqlblog.com/blogs/aaron_bertrand/archive/2009/03/21/six-reasons-you-should-be-nervous-about-parallelism.aspx That was three years ago, and I'm sure other equally dangerous bugs have come up since I wrote that. I haven't gone through and validated any that have been reported as fixed, but the ...


5

Two reasons can cause improvement of the same query over time: The data is changing The query plan is changing The data you can't do much about. To verify that the query plan is improving, try running the query manually during a time when you know the query is running at it's fastest. SAVE the fast query plan Run the same query during a time when you ...


4

This looks like a failed assertion in SQL Server code. Basically, you've uncovered a bug in SQL Server. You could submit it to Microsoft. A quick solution is to add option (maxdop 1) at the end of your query; this instructs SQL Server not to spread the query over multiple processors (aka parallelizing.)


4

You should find explanations for parallelism in SQL Server in these two questions: A query submitted from different applications has differing DOP and What is the meaning of DOP in the context of sql server? To enable the use of parallelism in first server you have two options: enable it at query level ( use option OPTION (MAXDOP 8) to enable the ...


4

SQL Server makes this decision based upon cost. If you execute 'sp_configure' (make sure advanced options are enabled) you will see an entry for 'cost threshold for parallelism'. If the optimizer estimates the cost to be greater than the run_value then your query will be executed in parallel. If the ORDER BY clause in your example results in an increased ...


4

As Peter Eisentraut correctly pointed out, first and foremost it's a licensing issue. Postgres is licensed under a BSD-like agreement, which makes it essentially a "free for all", so long as you credit the original developers in your derivative work. The MVCC vs. locking scheduler debate has been the subject of more than a few 'holy wars' online. The ...


4

If you wish to see the actual execution plan of a query that is running. SELECT plan_handle FROM sys.dm_exec_requests WHERE session_id = [YourSPID] First then enter the result into this query. SELECT query_plan FROM sys.dm_exec_query_plan (Enter the result here.) That will show you actual execution plan that sql used for that query. You could use that ...


4

Chances are the CXPACKET waits are actually disproportionately represented if you have a lot of threads waiting on something that is I/O bound. You can check this by setting MAXDOP=1 and re-running the query. See if the proportion of wait time from PAGEIOLATCH waits increases significantly. If your PAGEIOLATCH waits are a large proportion of the wait time ...


4

Parallel statistics update has been available since SQL Server 2005. It is documented in the TechNet article, "Statistics Used by the Query Optimizer in Microsoft SQL Server 2005": Where a full scan is performed (whether explicitly requested or not) the internal query generated for the data-gathering has the general form: SELECT StatMan([SC0]) FROM ...


4

You should consider Table-Valued Parameters and a new stored procedure that can take 1000s of invoices and deal with them as a set rather than the singleton insert you have now. Knowing how to write the procedure to deal with all invoices as a set would require first-hand knowledge of what the procedure does now with a single invoice. I wrote up a quick ...


3

Being able to commit more CPU cores to the processing of a request is a good thing, until the time it takes to reassemble the results exceeds the gain obtained from distributing the workload. Check to see if you have high CXPACKET wait time. If you don't, then no worries. That article gives you some things to try if you want to gain more understanding on ...


3

I built an MPP system on MySQL and I discarded the system for two reasons: 1) is Oracle 2) is the lack of hash joins - nested loop and index joins do not scale to the level required in a MPP system - again because Oracle inhibited the promised delivery of hash joins in the 5.x code line after it took ownership. MPP big data systems must have joins that ...


2

I've never seen the need to switch off or modify any parallelism settings in all my time with SQL Server (last millennium, SQL Sever 6.5) Following on from @StanleyJohns answer... An OLTP system with short, sharp queries should never hit the cost threshold ("cost threshold for parallelism") so it shouldn't matter. If you have some queries that do go ...


2

What causes parallelism?: There is a setting called cost threshold for parallelism. Once this threshold is exceeded then parallelism is used (if prerequisites are met). The nature of an OLTP systems is to have a large number of quick and short transactions. Using parallelism sometimes increases the query processing time, as the query will be split up to be ...


2

This should not be a problem as long as the data in the two dump files involves different tables... however, it may or may not be as helpful as you might hope, because if the single restore is only using 10% cpu, that suggests that your disk, as opposed to cpu, may be the more significant determining factor in limiting the speed of the restore.


2

Native, no. Heck, I barely classify the out of the box FTP component as a real component. It meets some technical specification for FTP only for the most rudimentary operations. I've usually gone the route of calling ftp.exe from the Execute Process Task with a parameter file or just used the .NET libraries for doing so. I had never thought about ...


2

Read Diagnosing and Resolving Latch Contention on SQL Server, is the most comprehensive paper on the topic. You'll have to dig into sys.dm_os_latch_stats and see what latch type is the contention on. See if reading How to analyse SQL Server performance helps you in any way.


2

In addition to reading the links provided above and most likely changing your "Max Degree of Parallelism" setting from 0 to something like 8, you'll want to narrow down which of your queries are going parallel and what their cost is. After seeing the impact of this change you can also consider modifying your "Cost Threshold for Parallelism" to fine tune ...


1

Suspended status doesn't tell you much; the wait type tells you the story. I would; Download and Install sp_whoIsActive execute the below command while the processes are suspended to get the leading blocker, it's wait type along the lock graph. This should show the lock areas. (please upload) exec sp_WhoIsActive @show_own_spid=1, ...



Only top voted, non community-wiki answers of a minimum length are eligible