Hi
I'm trying to optimize some reports on SQL Anywhere 12.0.1.3324. My test system is relatively strong for SQL Anywhere - 24 CPU cores with 24GB RAM. One of the main problem is that SQL Anywhere doesn't utilize the hardware resources or does it in an inconsistent way. I have found that the same query may use parallelism (Parallel Table Scan, for example) on one execution and doesn't do it on the next one. Note that I'm the only user in the system, there are no concurrent queries and the data is not changed at all. So my questions are:
I have more questions about SQLA intra-query parallelism, but I don't want to ask too many questions in a single post. I can upload query plans if required.
Thanks in advance Leonid Gvirtz http://www.gvirtz-consulting.com
Request clarification before answering.
Just another observation: All query estimates expect much more rows in the result set (3.7e+06) than there are actually (simply 1). This might prevent intra-query parallelism if the following doc quote holds here:
A query is more likely to use parallelism if the query processes a lot more rows than are returned.
The fact that your query does use a particular group by TYPE_NAME defined via a CASE expression might make it more difficult for the optimizer to pre-calculate the result sets's cardinality - apparently, group by a case expression with two branches can only return two rows at maximum...
As TYPE_NAME is simply dependent on one column of one table, how would the query perform if you turn the definition of TYPE_NAME in a derived table (based on S) and join that derived table with SU?
SELECT CASE WHEN S.SGSN IN ( -371269922, -555819298 ) THEN 'Home' ELSE 'Roaming' END TYPE_NAME, SUM(SU.OCTETS_IN), SUM(SU.OCTETS_OUT), SUM(SU.OCTETS_IN + SU.OCTETS_OUT) FROM SDR_USAGE_STAT_HRS_1_7 SU, SDR_STAT_HRS_1_7 S WHERE SU.START_TIME BETWEEN '2012-01-06 15:00:00.000' and '2012-01-07 03:00:00.000' AND S.SUBSCRIBER_ID = SU.SUBSCRIBER_ID AND S.SESSION_KEY = SU.SESSION_KEY AND S.SUBSESSION_KEY = SU.SUBSESSION_KEY AND SU.DEVICE_ID = 4 GROUP BY TYPE_NAME
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.