Feb 22, 2012 8:24 AM
Query Concurrency Performance
-
Like (0)
Hi,
Ok so lets assume two queries (different ones) are kicked off by the same user and are the only users of the database. I initially assume that each user would get 50% of the machine which would translate to the queries running 2x longer than their solo runs given the same conditions.
From what i am expereincing is a query that come back in a few seconds on its own runs for 100x longer when run with the other query which is a CTAS of a union of the one table used in the other "short" query".
Thanks,
Shaun
The system will interleave queries over time, but the granularity is at the snippet level. When a query is received, it is compiled on the host and broken down into a series of steps (snippets). When there are multiple concurrent queries running, the scheduler will figure out which query's snippet runs next (based on a variety of strategies and user controlled parameters). However, once a snippet is sent to the SPUs, the snippet runs to completion. One would assume the CTAS query has a step that moves a lot of data and got to the spus before the other query was done with all of its steps. This delayed the completion of the smaller query.
The fact that both queries access the same table is coincidental and has no detrimental effect on the clock times.

