« first day (781 days earlier)      last day (4384 days later) » 

00:14
Any mods in-da-house?
00:44
@MarkStorey-Smith >.> I am here now
I've been here but not monitoring chat?
Nothing urgent old chap, don't panic :)
No panic ;-)
Wasn't sure if @ShawnMelton would see my ping in dba.stackexchange.com/questions/35292/…
If he will, no worries. If he won't, can you do your mod magic ping thing :)
@MarkStorey-Smith What? :)
@shawnmelton got a minute to see a chat ping from @MarkStorey-Smith ???
done
00:51
@Phil Beer, free beer. Free beer and swag! What's not to like!
@jcolebrand Muchos gracias
@MarkStorey-Smith you say that while I'm sitting at my desk enjoying a beer :D
Ahh the joys of working for a startup. Beer at your desk and nobody complaining
@jcolebrand Good office Karma
So very much
@jcolebrand I insist on same whenever I'm in the Bucharest office on Fridays :)
And they pay me to moderate StackExchange sites ... I mean, to write sloppy code ... I mean, to do a very diligent job writing software
00:57
@jcolebrand and to drink beer
01:11
Sorry, you'll have to enlighten me. Just got back from working in the pub and there were many chat notifications - a few saying I should be hired and others saying that there was beer available. I like both things :D
@Phil I am enjoying a beer at my desk
Sorry, DBA.SE > SO.
So nope :)
You are @ypercube! FFS @Υπερκύβος
Change it back
ok. I will do.
Didn't mean to be rude mate.
I couldn't auto-complete
:)
Cut-n-paste worked, but you're not a cut-n-paste bloke. :)
01:18
It's getting more difficult it's time to find a new SE site to register :)
01:29
If I type "@Y" and press tab, nothing happens. Too late in the evening to work out the odd "Y" you're using. Fraud!
Also, why I h8 i8n!
it's not odd. it's the original Υ :)
 
4 hours later…
05:12
Wondering if I should ask about key rotation of encrypted data here or on another site. (I have asked here on DBA but having second thoughts, maybe programmers would be a better fit?)
0
Q: Database encryption and key management with pg_crypto

Chris TraversI am looking at the possibility of having to store root passwords for virtual machines in reversibly encrypted format in a database. The reason is that local logins will sometimes be required to machines as much as they are discouraged and we need to be able to look up root passwords. Access of...

 
3 hours later…
08:42
heh, got downvoted over standing up for long queries.
 
1 hour later…
10:01
Saturdaily WTF
-1
A: Why shouldn't we allow NULLs?

Amirreza KeshavarzRefer to Database Design solutions , there should be no null in Your DB , Except One Situation. It Shouldn't Have Null , Because Reporting , And Writing Query in order to Pull Out Reports would be more, and there Would be more load on Engine. You can make another table , that is Called 'Details o...

@ChrisTravers Where exactly?
Anyway, your key rotating Q is not quite clear to me
10:14
This one I don't understand either:
0
Q: Multiple parents and multiple children in product categories

rajeshI am making a ecommerce site. In this site I want to categorise the items into three different layers primary category sub category sub category >>electronic >>smart phone samsung cameras tablets nokia ...

1
A: Is it better to seperate a big query into multiple smaller queries?

Chris TraversI am going to disagree on large and complicated queries with datagod here. I see these only as problems if they are disorganized. Performance-wise, these are almost always better because the planner has much more freedom in how to go about retrieving the information. However, large queries do ...

got voted down due to preferences over long vs short queries given that it appears to have been downvoted at the same time a post criticizing maintainability of long queries was upvoted.
As for my key exchange one, I want to rotate encryption keys but the question is what the best way of doing this is so that we can ensure that users can, in fact, access the sensitive information after a key change.
do we just email out new keys? (I would rather avoid that) or maybe it would be better to use public key encryption of a symmetric key?
@dezso I don't like exceptions. If he is on the "clean path of exterminating all Nulls", why leave a few?
@ypercube because those are useful NULLs? who knows
I liked your Greek name, too bad it's gone
@dezso Cache settings are funny. I still see it here.
10:31
@ChrisTravers I'd vote on the latter, possibly coupled with a one-time password or two users required for access
no idea how these could be achieved by using pgcrypto tho
Not sure about one-time passwords in pgcrypto, but it can do both public key and symmetric encryption :-)
@ChrisTravers well, datagod's argument is not extremely well backed by facts or whatever (and OP's comment is a hit)
anyway, the query used in the Q itself isn't considered long or big at all :) (at least by me)
@dezso Yeah on both counts.
additionally while I have run into long queries that were a pain to maintain, they were never a pain merely because they were long and complex.
The issue was that they included something like ten inline views joined together in complicated ways and lots of subselects....
@ChrisTravers exactly
if I write long queries, those are typically quite readable - more made readable along your lines in your answer
@dezso I have concluded the difference is this: In theory a sql statement acts within a single state, so you can assume no state changes within the context of a single query.
10:44
views and CTEs are magic and can render big joins involving terrible pivots (well, crosstabs is PG) an easy pie (at least until some 'clever' query formatter does not ruin the whole lot with superfluous parentheses and arbitrarily placed whitespace)
this means you start looking at a 400 line queries by saying "may be either a bad filter or a bad join condition" and that narrows the likely block of code usually to a few lines....
@dezso agreed.
@ChrisTravers can't you start a serializable transaction from app level? (half joking)
@dezso I mean your app code wouldn't be much of app code if state changes didn't happen ;-)
It's hard for an application to do anything without state changing in the application layer.
So there's a lot more of "how did we get here?"
@ChrisTravers: CTEs help in readability but I guess the question is about MySQL.
@ypercube yeah, that was made clear after my answer. In that case, at least I can say I warned that they wouldn't be available there.
I will probably edit to clarify
11:37
Hm. "Performance-wise, these are almost always better because the planner has much more freedom in how to go about retrieving the information."
I spend more than half my life simplifying over-complex SQL queries. Big queries give the optimizer more opportunities, in some cases, but much more frequently they give it scope for poor decisions. Big queries -> big plan search space -> more heuristic decisions and also the quality of cardinality estimations tends to decline exponentially with plan complexity.
The particular SQL in the question looks horrible to my eyes. Perhaps MySQL does not support EXISTS? In any case, it looks like SQL written by someone very new to the language, whose primary (only?) tool is IN.
EXISTS is supported fine (and I prefer it). IN has in many situations horrible performance in MySQL.
12:16
@PaulWhite When you say simplifying are you talking about breaking up into multiple stages/round trips, or rewriting complex queries into simpler but still single queries?
My recommendation for complex queries is to move from MySQL to PostgreSQL in part because if you have big plan search space, geqo gives you some options for tuning heuristics thresholds, etc.
@ChrisTravers Typically multiple simpler queries in a stored procedure or function, using temporary tables to store intermediate results. Getting statistics on the intermediate results is often an easy win. Of course I am a fan of writing good SQL as well :)
I would avoid multiple round trips, obviously.
12:54
@PaulWhite What do you think is the length you'd start worrying about refactoring in this way?
@dezso: You have NULLs? Horror!
I have NULLs in my database and I still can build nice and performant reports on top of it... At the same time, I don't see how a NULL would cause 'more load on Engine'. — dezso 2 hours ago
13:35
No mod around, @JNK?
-1
A: Why shouldn't we allow NULLs?

Amirreza Keshavarzsorry I don't know how would this delete

2 answers need to be deleted.
14:10
@ConcernedOfTunbridgeWells Awesome answer btw on the NoSQL vs rdbms scalability question.
@AaronBertrand I sometimes use UDF's in check constraints. They are a wonderfully powerful took but a dangerous one to be used sparingly as a tool of last resort. They simplify RI checking when DRI is not sufficient for example.
@ChrisTravers Sorry, I was busy elsewhere. It's not so much length (SQL statements can become quite long for good reasons) as it is looking for 'red flags' either in the query text or in the execution plan.
@PaulWhite Just curious, what sort of red flags do you look for (the ones I look for tend to be inline views and subqueries)
14:40
@ChrisTravers if you know all of the potential problems, ok, but I would never recommend it on the site because people will run with it, think they're ok to use everywhere, and then get bitten and blame me
@AaronBertrand Part of the problem is hand-rolled referential integrity isn't the easiest thing in the world. If you have to go there, all of the tools can bite you.
@ChrisTravers but most of them don't randomly fail to enforce things in certain situations (which most of the audience of StackOverflow will never comprehend).
@AaronBertrand Unlike custom-written constraint triggers? ;-)
Actually I think over-enforcement is a bigger problem :-P
(triggers can be temporarily disabled while loading backups while check functions and udf's mean you will check referential integrity while restoring)
@ChrisTravers no I mean instead of a check constraint that doesn't use a function for no good reason other than "let's put all of our simple logic in a function"
@AaronBertrand Oh ouch, yeah. Don't do that.
14:48
@ChrisTravers and still I think a check constraint using a UDF would be my last option on earth to enforce anything. Of course you can bypass any checking you implement if you're determined, but it's the most brittle of all the options IMHO. I don't know how long you've been working with SQL Server but if you'd been bitten by this I think you'd be less of a proponent.
I haven't worked with SQL Server much. There are a number of cases where they are very helpful in PostgreSQL tough
for example doing what they call "collection tables" in informix. It's about the only way you can reasonably enforce sub-column-level constrants.
A collection table would be where you use tuples in columns, perhaps as a light-weight custom type system.
(This doesn't necessarily violate normalization btw)
 
1 hour later…
15:56
@ChrisTravers It sort of needs an answer like that to direct fanboi arguments to. If you suggest 'go and read this first before blathering on about web scale' (or words to that effect) then it becomes a FAQ with a go-to answer.
16:17
My google-fu fails me. Does anybody know how the faq tag on 'questions' works? (i.e. how questions are selected for this?)
Is it just questions with the most other questions closed as a duplicate of that question?
16:39
7
A: How are the FAQ questions chosen?

MatThe tooltip on that page says: Questions with the most links It's not restricted to "closed as dup" links - any question from the same site that is mentioned (in the question, answers or comments) gets "Linked".

16:58
@ypercube Jolly good.
17:18
@ConcernedOfTunbridgeWells I have some (still vague) requirements for a project that includes "cohort analysis" of web analytics data. Is that an area you have worked?
@ypercube I just got asked about data mining by @MarkStorey-Smith a day or two ago. I'm not really an expert in data mining.
I take it your requirement is to try and categorise users of a web site into cohorts based on their patterns of usage?
This is a blurb about the data mining facilities in SSAS 2012.
The requirements are stll vague. Waiting for them. All I know is that it involves Google Analytics.
@ypercube I'm pretty sure GA has a stream analysis tool built into it. You set up beacons in the site that GA uses to collect the stats and GA lets you do various types of analysis on them.
I've never set GA up on a site, although I did a gig once where they had.
17:54
Could someone validate my comment?
I don't see how a dynamic SQL statement affects the execution plan... All you are doing is writing the statement to be executed dynamically, then executing it. — Aarolama Bluenk 1 min ago
 
3 hours later…
20:39
@PaulWhite Nice solution on the
3
Q: Query records that chain together based on date gaps

JustinDoesWorkI have a table in SQL Server 2012 with the below simplified schema and I need to define a query that grabs the most recent record and then returns the chain of records that have less than 30 days of a gap between them. Once there is a gap of more than 30 days the chain is broken and does not cont...

20:50
I wonder if the Departure should be used for the orderings, in case there are complete overlaps (like a ('20000101', '20091231') reservation.
 
3 hours later…
23:29
@ypercube Quite possibly, yes. I must admit I didn't think about the problem very hard at all. At first I was hoping to give the guy the tool to do the job rather than present a completely finished solution, but responding to his comment I suppose I've kinda moved in that direction. Perhaps I'll look again later. I just can't get excited about the problem for some reason.
0
Q: Where Hadoop Stands at MongoDB Side

kamaciI am making a research about Machine Learning and planning to use NoSQL databases. I know that MongoDB is a powerful solution. However I want to learn that where Hadoop stands for MongoDB side. My question is that: Does it a core engine for MongoDB or can I use Hadoop itself without using Mong...


« first day (781 days earlier)      last day (4384 days later) »