« first day (1574 days earlier)      last day (3302 days later) » 

4:16 AM
@AndriyM Oh thanks - I hadn't noticed that. It probably does belong here. Migrated now.
 
 
2 hours later…
5:58 AM
@PaulWhite Just observed the same plan shape but correct result if you do a calculation on the column.
SELECT T1.c1, C.c1
FROM #T1 AS T1
CROSS APPLY
(
    SELECT COUNT_BIG(*) AS c1
    FROM
    (
        SELECT T1.c1 + 0 as c1
        UNION
        SELECT NULL
    ) AS U
) AS C
OPTION (CONCAT UNION);
 
@MikaelEriksson Yes I tried the same thing early on (adding zero etc). I'm pretty sure the root cause is an unsafe byref/late evaluation/binding issue it's just too hard to capture.
BTW I just reproduced it in 2005.
@MikaelEriksson So my saying things like "problematic plan shape" is a simplification, hopefully not a gross one. It was a conscious decision; I have to draw the line somewhere between being intelligible and being last-level-of-detail accurate.
 
I was really trying to see if I could create the error without having the Distinct Sort in there (no luck so far) when I stumbled on that. I guess the sort is what is making the optimizer to use the spool in the first place.
I thought it a likely culprit to mix things up in an internal structure.
But since it does not do that with a + 0 that is probably not it.
 
6:19 AM
@MikaelEriksson Partly, yes. Try a TOP (1) with ORDER BY instead of the aggregate. Also OPTION (HASH GROUP) or OPTION (QUERYRULEOFF GbAggToSort).
@MikaelEriksson There's just not enough information in showplan to narrow this down. It's a couple of layers deeper in the way expressions and column references are passed around at the execution engine code level.
 
@PaulWhite The query plan is as deep as I go. Spelunking with the debugger in SQL Server is not something that I do comfortably.
 
e.g.
SELECT T1.c1, C.c1
FROM #T1 AS T1
CROSS APPLY
(
    SELECT TOP (1) c1
    FROM
    (
        SELECT T1.c1
        UNION
        SELECT NULL
    ) AS U
) AS C
OPTION (CONCAT UNION, HASH GROUP);
 
Yep, wrong result, no sort.
 
Yep and there's all sorts of other variations too.
Fascinating edge-case bug.
 
6:41 AM
Tiny changes to the query makes it work as expected. One extra UNION, calculation + 0 and a where clause SELECT T1.c1 WHERE T1.c1 > 0.
Did you try it parallel :) ?
 
6:55 AM
No I don't remember trying parallel.
An extra e.g. UNION SELECT 1 doesn't help on its own.
 
0
Q: Why is this question off-topic?

sjkRecently, a question that I answered was voted off-topic. I would like a clarification why exactly is this off-topic? I think the question was relevant to this site. It might not have an exact answer, but imperfect information that can be gained in this situation is better than no information at...

 
QUERYTRACEON 8649 will give you correct result.
 
Yes I saw.
Probably the copying in the exchange buffers.
 
@PaulWhite No, I meant using a ref to another column.
 
Oh OK.
 
6:58 AM
Same column or another constant value will still give wrong result.
 
Yes it's very fragile. No wonder it has been around for so long without anyone noticing.
 
Microsoft has fixed something that I would think impossible to fix "Incorrect choice of a nested loops join strategy causes poor query performance in SQL Server 2014"
(https://support.microsoft.com/en-us/kb/3042544)

"This behavior occurs because the query optimizer chooses an incorrect nested loops join strategy when incorrect cardinality estimates or incorrect operator costing is used."

The cardinality is incorrect and the costing is incorrect and yet the optimizer now manages to choose the "correct" plan. Sounds strange to me.
 
7:29 AM
Most KB articles are worse than useless recently.
I imagine that one is a new-CE regression/bug, but it's impossible to say from the vague KB text.
 
I gave some feedback. Continuously pressing F5 to see the update they surly will make.
 
Hope is cheap :)
 
Ha ha
 
 
2 hours later…
9:38 AM
-2
Q: I recently asked a question which was put on hold as too broad, would like some help on improving it

Dani_lwhat-are-best-practices-to-setup-mariadb-galera-10-0-on-shared-nfs-storage-emc I'm not really sure how to narrow the question, as I'm basically looking for a link/site, or a white paper which documents established best practices. I'll be happy with a rather vague bullet-point list of do/don't, ...

Needs another kill shot
 
@Phil Gone...
Shall we reopen the actual question?
0
Q: what are best practices to setup mariadb galera 10.0 on shared nfs storage (emc vnx)

Dani_lAs the subject states, I'm interested in setting up a MariaDB Galera cluster, using a shared nfs storage to host the db data. I've searched but couldn't find any resources with "best practices" for such a setup. I'm not really sure how to narrow the question, as I'm basically looking for a link...

I edited it a few days ago, when I had first seen the meta.
 
9:53 AM
@Phil Regarding the meta Q you've just answered, its author is not the one who asked the question on the main site.
 
@AndriyM Ah, oops
 
10:05 AM
@Phil Yeah, he was the one who answered it.
 
@ypercube Why not. Give it another chance in life.
 
 
2 hours later…
11:41 AM
It's not hard to get even marginal edit suggestions approved on this site, yet...
 
11:58 AM
@AndriyM Yes I know - I hit Approve on that one by mistake. Not possible to undo, luckily @ypercube caught it.
 
@PaulWhite Ah, no, I was reading this review: dba.stackexchange.com/review/suggested-edits/45100 and noticed that @ypercube rejected and edited the suggestion but it didn't count for him as a rejection.
tried to post it as a quotation, couldn't post a multiline message
Test
Ah, now it works
 
@AndriyM Looks like it counted as a rejection to me:
From here
 
No, I meant it didn't count towards @ypercube's rejection count. It says there, "ypercube has approved 0 edit suggestions and rejected 0 edit suggestions".
Not sure if it's a bug or it's meant to be like that.
But I'm sure it's a perfectly trifling matter.
 
12:18 PM
@AndriyM Hm that is weird!
 
JNK
12:37 PM
morning all
 
morning
 
morning
 
1:05 PM
morning
 
1:30 PM
snoring
 
1:44 PM
how was all ya'll's weekend
 
1
Q: Is Service Pack 2 completely installed on Passive Node of SQL Server 2012 Instance?

echoScoutWe are applying SQL Server 2012 Service Pack 2 (SP2) to a two-node active/passive cluster, starting with the passive node (as per best practices): How to install a Service Pack at a SQL Server 2012 Failover Instance: Best Practices (http://blogs.msdn.com/b/john_daskalakis/archive/2014/09/05/how...

This question seems off to me, especially the way the OP answered what the end solution was...leave or close?
 
If it worked for him, it worked for him. Might help someone else in future, I say leave it be.
 
JNK
2:05 PM
@Kermit kids started Tball. It was bananas
 
@JNK that's pretty nuts
 
JNK
3-6 year old tball is just straight up chaos
 
balls must be flying
 
JNK
no not really, rolling some and getting chased
and kids running every direction
trying to throw balls from gloves
 
ha
sounds adorable
took my toddler to the play place at the mall
definitely not a crawler's paradise
 
JNK
2:15 PM
ours has a separate area for crawlers thankfully
 
2:26 PM
damn that would be nice
 
@JNK robots.txt?
3
 
Bravo
 
> 23. Denver currently has more marijuana dispensaries than Starbucks stores.
 
@swasheck nice
 
What costs more, a fancy SB drink or an MJ cig?
 
2:42 PM
i dont know
hahahahahah
> Most of the trees in Denver are not native. Being a high desert plain, the only trees indigenous to Denver were some cottonwoods and scrub oak that grew along the Platte river. All the others are "immigrants."
 
Every coding tutorial ever written. - @ossia http://t.co/kV3XFbBAf7
 
@billinkc how is that funny
 
@Kermit I've being saying that for every @billinkc's comment
5
 
@Lamak i'm glad we agree
 
2:51 PM
That's nothing I'd celebrate
 
@swasheck HAHAHAHAHAH that's hilarious.. finally some comedy in this room
Damn it Gordon
Vertica doesn't use indexes. — Kermit 13 secs ago
 
@Kermit now that's comedy
 
Doing some part-time consulting on the side for a friend. Their DBA, when asked why he never runs DBCC, responded with 'It interfered significantly with our processing (we know that, there are other ways to run DBCC CHECKDB besides just on the actual, live DB)... In addition, I have not seen any other signs of data corruption'
 
@swasheck I've heard that claim before.
 
3:03 PM
That last sentence
I. Just. Cant.
I don't notice any signs of internal engine wear, doesn't stop me from getting my damn oil changed
 
My brakes/tires have always worked, why should I check them for wear?
It seems to me that some people just want to be ignorant.
 
If it was really important, it'd just happen. Look to the lilies of the field
 
I get it, you have a 24/7 system that cant afford the performance hit but you also have a test instance. Idea, RESTORE your backups (takes care of testing your backups and making sure they're good) and run DBCC on the test instance.
 
@swasheck I claim they have an index for every column.
 
@ypercube sure. so. diminishing returns?
 
3:20 PM
comment on a planned column:
> 'null values shall be treated as false'
 
if only the sql standard allowed for a default value.
 
the explanation is that it takes long to set the value on the existing rows
we have proper tooling to handle these cases
 
it sounds like you have the tools, at least
 
well, UPDATE is one of them :D
but there is a nice slow script gradually doing the stuff without bothering others
 
maybe you can write a cursor to update each individual rows
 
3:31 PM
hm, I'll propose that to them
(actually the slow script can do that if we want it to be really slow - does not happen very often, the emphasis is on non-obtrusive, not on slow)
 
oh. i was being sarcastic.
 
3:48 PM
1
A: What exactly can SQL Server 2014 execute in batch mode?

Paul White What exactly can run in batch mode as of SQL Server 2014? SQL Server 2014 adds the following to the original list of batch mode operators: Hash Outer join (including full join) Hash Semi Join Hash Anti Semi Join Union All (Concatenation only) Scalar hash aggregate (no group by) Batch Hash ...

@PaulWhite ... thanks for that answer
 
No worries. I hadn't seen it before for some reason. Found it in the Unanswered questions list.
 
 
2 hours later…
5:22 PM
@swasheck: this is probably the best description I could find of Vertica's "projections".
I still claim they are indexes.
 
@ypercube I support that claim
 
that's fair. i'm not arguing against it.
 
Oops, I forgot the link!: The Power of Projections – Part 2
> For each table in the database, Vertica requires a minimum of one projection, called a “superprojection”.
(something like a compressed clustered index, automatically partitioned as far as I can understand)
 
Sounds like arguing a columnstore index in SQL Server isn't an index.
OMG we are discussing Vertica.
3
 
BOOM!
 
5:35 PM
What have you done Kermit ...
 
and not for making fun of @Kermit
 
Congrats, universe, you win
 
Time to close The Heap. We're done.
 
perhaps it should visit a counselor, what with all of the projecting it's doing
3
 
BOOM!
 
5:39 PM
I see what you did there
and I LIKE IT
 
if you liked it then you shoulda put a star on it
 
@ypercube actually, more like a materialized view
no such thing as an index
 
materialized view / index, I see no big difference
 
Is that why I can't find any information on Vertica Booom?
 
@ypercube except that storage is at the column level
 
5:51 PM
@Kermit compressed column-index?
 
@ypercube no index. it's the physical storage layer.
encoded and/or compressed
 
So a clustered index is not an index now?
@Kermit Sorry if I sound stuborn.
But all the "no indexes" claims, sound like the anti-vaxers ;)
 
@ypercube an index points to a physical storage location
yes or no?
 
No.
 
Okay, forgive me then.
 
6:00 PM
At least in SQL-Server and MySQL, clustered indexes are the tables. And secondary indexes only have the PK, as a reference, no other "point" to anything.
 
Following that, the default "index" for Vertica includes ALL columns.
2
 
6:11 PM
Like, just all columns in INCLUDE (...)?
 
@AndriyM Yes, or more like a CI.
 
@ypercube I was going to ask that.. isn't that basically like a clustered columnstore index?
 
@mmarie Yes, it seems so. From the 3rd part (link above):
> In a highly simplified view, you can think of a Vertica projection as a single level, densely packed, clustered index which stores the actual data values, is never updated in place, and has no logging.
 
ah. ok.
 
What is not mentioned in the links I found, is how unique constraints are enforced. @Kermit?
 
6:24 PM
@ypercube they're enforced at query time, not load.
 
@Kermit meaning?
 
@ypercube if you create a primary key, unique key, or foreign key, Vertica will not enforce it at load time. you can opt to not commit the load and run a function to check the uniqueness, otherwise, it will enforce at query time
it's too costly to check for duplicates during load
 
Ok, this is too much. The same DBA that gave me that excuse of not running DBCC CHECKDB because he hasn't seen signs of corruption also told me that because he has transaction log shipping that his backups must be valid.
 
@mmarie @ypercube the central difference is that Vertica is an OLAP platform. it does analytics fast (load & query)
 
@Kermit Yeah, ok.
One - last, I promise - question for you:
 
6:28 PM
feel free to ask away
 
Say we have a trillion row table, with only 1 column.
 
that's small
 
JNK
@KrisGruttemeyer huh?
 
and we run the query: select name from table where name >= 'f' and name < 'g' ;
Does it have to read the whole column projection? (How does it find the first name that starts with 'f'?)
 
on a high level,
 
6:32 PM
@JNK I'm doing part time consulting, just helping out a colleague who needs some help getting her servers under control. I asked their DBA when the last time his backups were tested was and he said he didn't need to because he has log shipping and that covers it.
 
it could use something called RLE (run length encoding).. so it only stores
f, 58
g, 86
and it will sort it that way
 
He also said part of the reason he doesn't run CHECKDB is because he 'hasnt seen any signs of corruption so far'. That and because he cant get a maintenance window. He has a test server, just restore your backups there and run DBCC on the test instance
 
That's like saying you don't have a smoke alarm because you don't have a fire.
 
@Kermit what are the 58, 86?
 
@ypercube it will quickly know to get the containers with the 58 f's and 86 g's
 
6:34 PM
@JamesLupolt EXACTLY MY POINT. Haha
 
@ypercube counts
 
@ypercube counts
 
I won't change the oil on my car because it shows no signs of needing it
 
damn my slowness
 
@Lamak you're so smart. come work for us
 
6:36 PM
well, you said it was an OLAP platform, so
 
@Lamak There's an index for that
 
@KrisGruttemeyer I don't know how to use it
 
But not on Vertica
 
@Lamak The struggle is real
 
I just want to BOOM with all this Vertica discussion
 
6:48 PM
Is there a good article that talks about the conditions of when it would be better to do a CCI vs just regular indexes? I have found stuff like this: sql-server-performance.com/2014/…
but i am looking for something more specific.
I inherited a data mart with 6 dims, 1 fact table. The fact table has 6 million rows and uses a clustered columnstore index. I don't really understand why, other than they wanted to try it. I think it would have been fine without it since the only thing that queries it is a tabular model when it is refreshed twice a day (and that is not likely to change over the next year or two).
I guess it's not hurting anything, but it just seems odd.
 
@mmarie are aggregates present in a majority of the workload?
 
I don't understand the question
 
the queries. do they have a lot of SUM COUNT MAX etc?
 
no. most of the queries are simply to load the data into the tabular model. The aggregations are done in SSAS.
 
my extremely limited understanding of CCSI/CSI would lead me to believe that you'd not experience a tremendous gain from them ... and you'd have to introduce some index maintenance into the data store to handle anything not caught by the mythical tuple-mover
 
7:03 PM
@mmarie where better to try it than in a production data set.
 
@swasheck This is my thought, too.
A client broke ties with their former consultants and called us, and that is what I found when i looked at their existing solution.
Normally, i wouldn't care, but this was for a company with no DBAs and no BI staff. They just needed something easy to maintain and easy to understand. I have a soap box about consultants who do things that are complicated/new that aren't appropriate for their clients based upon ability to enhance/maintain after they leave.
 
ruh roh.
 
wth?
how'd that happen?
@mmarie yeah. seems like a "use the client's prod environment as a test lab" scenario
 
that is my guess, too. but i wanted to give them the benefit of the doubt.
 
7:19 PM
@mmarie You should know better than that :)
 
Yeah that definitely sounds like the case.
 
 
1 hour later…
8:28 PM
"we'd only be pulling 7GB of data each night, why can't we use a linked server?"
 
...
I say you let them do it and drink their tears when it fails.
 
@MikeFal i'm sorry. "@#&*$()#@&*($)#&*( ... YOU'RE FIRED" is the correct response
@MikeFal they will never be held accountable and we'll accumulate technical debt because it it. in the end ... it'll be our fault.
 
I have felt that feel
 
DBA = default blame acceptor, act accordingly
 
so anyway ... i've recently met and fell in love with ConEmu
 
8:54 PM
Is today a holiday somewhere?
 
Probably
 
It's LMA (Last Monday in April) Markets are open but in the republic of BillInKFCstan it's a compulsory day of not giving a F
2
 
thought that was every day
 
We have many holidays during the work week
 
at least 8
 
9:09 PM
It was ANZAC day yesterday
So all my NZ counterparts got a day off, but not me.
 
poor you
i had the day off by virtue of the fact that it was sunday
 
9:35 PM
Yeah, but that was Monday for them.
Because New Zealand.
 
@MikeFal oh yeah! I forgot about that. I should really start asking @PaulWhite what things are like in the future!
That's how that works right....
 
10:12 PM
totes
@MikeFal f that noise
 

« first day (1574 days earlier)      last day (3302 days later) »