December 13, 2016 at 5:07 am
Hello all,
The same query with a group by clause I try to run on SQL Server 2005 and on SQl Server 2014 but it seems that every time i run the same thing on SQL server 2014 gives me a different output different results when i press F5. In SQL server 2005 its consistent with the results
Any ideas why this it ?
thank you so much in advance
December 13, 2016 at 5:17 am
Unless you post the query, I'm just guessing. I imagine that you have different data in the tables on the two servers.
John
December 13, 2016 at 5:24 am
zouzou (12/13/2016)
Hello all,The same query with a group by clause I try to run on SQL Server 2005 and on SQl Server 2014 but it seems that every time i run the same thing on SQL server 2014 gives me a different output different results when i press F5. In SQL server 2005 its consistent with the results
Any ideas why this it ?
thank you so much in advance
Please do what you can to give us some proof. There is no known 'random results mode' for the GROUP BY statement.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
December 13, 2016 at 5:50 am
zouzou (12/13/2016)
Hello all,The same query with a group by clause I try to run on SQL Server 2005 and on SQl Server 2014 but it seems that every time i run the same thing on SQL server 2014 gives me a different output different results when i press F5. In SQL server 2005 its consistent with the results
Any ideas why this it ?
thank you so much in advance
Does the query have an order by clause? Given that the data is the same, if it doesn't have an order by clause, then the difference would most likely be the new cardinality estimator choosing a different plan than the earlier versions and since no order for the output is set then the results will be "in order of appearance"
๐
Can you post the actual execution plans for those queries?
December 13, 2016 at 6:00 am
zouzou (12/13/2016)
Hello all,The same query with a group by clause I try to run on SQL Server 2005 and on SQl Server 2014 but it seems that every time i run the same thing on SQL server 2014 gives me a different output different results when i press F5. In SQL server 2005 its consistent with the results
Any ideas why this it ?
thank you so much in advance
I have numerous queries which are designed specifically to generate different results every time they are executed, primarily for generating test data. None of them contain a GROUP BY. I'd be interested to see your query.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
December 13, 2016 at 6:19 am
Gut feel: there's a TOP without an ORDER BY.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 13, 2016 at 7:40 am
GilaMonster (12/13/2016)
Gut feel: there's a TOP without an ORDER BY.
Good choice. There are other reasons, but I would go with this one as well.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 13, 2016 at 8:05 am
SELECT
RTRIM(Ax) AS A,
RTRIM(Bx) AS B,
RTRIM(Zx) AS Z
FROM TEMP1 A
LEFT OUTER JOIN TEMP2 B on A.Zx = B.Zx
GROUP BY A,B,Z
December 13, 2016 at 8:11 am
zouzou (12/13/2016)
SELECTRTRIM(X) AS X,
RTRIM(Y) AS Y,
RTRIM(Z) AS Z
FROM TABLE A
LEFT OUTER JOIN B on A.X= Y.Z
GROUP BY X,Y,Z
That query won't run.
December 13, 2016 at 8:16 am
Well I know I made the mistake but this the query please forginve me if I put a wrong letter somewhere will send you in a moment the plans
December 13, 2016 at 8:23 am
zouzou (12/13/2016)
Well I know I made the mistake but this the query please forginve me if I put a wrong letter somewhere will send you in a moment the plans
There's nothing to forgive. You just need to post helpful information if you want helpful feedback.
December 13, 2016 at 8:28 am
attached the estimated plans
December 13, 2016 at 8:41 am
You need to post the plan files, not just images. If you need to anonymize the names for privacy issues, you could use SentryOne Plan Explorer.
The pictures just don't reveal enough information.
December 13, 2016 at 8:45 am
Was in a rush my mistake check now. Any ideas or help much appreciated
December 13, 2016 at 8:49 am
zouzou (12/13/2016)
Was in a rush my mistake check now. Any ideas or help much appreciated
If it's as simple as that, I would say that you're not getting different results, you're just getting your data set ordered in a different way due to the lack of an ORDER BY and the presence of parallelism only on one version.
Viewing 15 posts - 1 through 15 (of 41 total)
You must be logged in to reply to this topic. Login to reply