« first day (407 days earlier)      last day (4462 days later) » 
01:00 - 18:0018:00 - 00:00

1:27 AM
aye aye aye what is wrong with people? stackoverflow.com/questions/9286446/…
RTFM the difference between OUTPUT and SELECT
These are the type of people I hope stay on SO and don't find dba.se.
They are bringing down the average wage for database professionals
 
2:25 AM
Brilliant. Just checked our documentation, and under "Disaster Recovery - SQL Server" is a blank section. :D
 
JNK
@AaronBertrand is this person a DB pro?
 
2:54 AM
@JNK I hope not
 
If he's not a DB pro then I think he did the right thing.
If you don't know what you're doing, do not give disaster recovery options.
however you still need to find someone to give you that information
 
Wait were we talking about me, or that SO poster? I'm confused now
 
3:12 AM
Oh, sorry, I thought the two went together. That plus a phone call makes a disoriented conversation.
whoops
 
We do have a DR plan. Somewhere.
I should probably fix our documentation
 
That's like my daily motto
"I should likely fix our documentation"
 
4:05 AM
I'm not sure if ge's a DB pro. But if he's doing that DB work for his company, he's taking DB work from someone else. Not that everyone doesn't start somewhere, but I gave several clues in that answer that just went way over his head.
It takes all kinds, and I probably over-reacted. The whole interaction was just frustrating and I should have given up sooner.
 
4:23 AM
A lot of shops don't have a dedicated DBA, so someone dabbling it it will be the best they get
 
My old company laid off 30 people today. Guess I had them in mind... this guy couldn't understand OUTPUT vs SELECT and my friends didn't even get severance. Just seems a little unbalanced. :-)
 
 
1 hour later…
5:32 AM
Uhoh. Suspect databases after patching, something tells me this is not going to be a happy evening
 
5:45 AM
No, suspect sounds bad
 
even better, those suspect databases are: our email archiver, our HR system and our time-tracking system
We've got full backups and tranlog backups right up until this patching period started, so worst comes to worst we restore those and nobody should be any the wiser
I just want to dig into the cause of the problem a bit first
 
6:02 AM
Root cause: auto-starting service + disks that weren't quite quick enough on the draw = failure to read from disk
restart the service and everything's happy as larry
 
 
3 hours later…
9:22 AM
Going to link that around work I think
 
gbn
I've always tried to do this (at my last bank). methods, encapsulation, interfaces: all good OO stuff. WhyTF can't be use them for DBs?
 
@gbn To some extent limitations of a query language that's tightly bound to the architecture of the query optimisation system. I did write a missive on this once.
Oracle gets around it to some extent in PL/SQL with some type inference functinality through the %TYPE and %ROWTYPE operators, but I think a set of features like local, paramaterisable synonyms, better functionality to accept table variables or references to tables in stored procedures and so on could be implemented without breaking the query optimiser.
You might get something that needed to recalculate query plans unless it could somehow prove statistical equivalence of what you've supplied as a parameter to whatever the optimiser calculated the original query plan based on.
 
gbn
You can carry the OO analogy so far, then it breaks.
At a tangent: this is why views are abused. "we can encspualate these joins"
 
PostgreSQL does have an API for hooking stuff into the optimiser and a framework for building specialised trees (called GiST or some such).
Oh, yes. Working with databases has done more to disabuse me of the concept of OO being a universally applicable paradigm than anything else ever did.
 
gbn
i think we're agreeing from different angles
 
9:35 AM
@gbn We are.
I'm just pontificating on some of my earlier pontifications on this topic.
I've found code generation systems are often a good way to make generic SQL operations - at least in situations where you can drive it off metadata.
 
gbn
@ConcernedOfTunbridgeWells never needed to do that
if the model is clear, then everyone can sing from the same sheet
Bundle the O-R stuff into some layer
 
@gbn depends on the problem you're tackling.
 
gbn
Hence my push form Object Role Modelling. I have to counter EF "code first"
@ConcernedOfTunbridgeWells brand new database here (OLTP). Mostly OLTP systems before-
 
@gbn If you've got a new database then you can optimise it to play nicely with ORMs - if you've got half-decent modelling skills in-house then you should be able to make an ORM work well.
 
gbn
@ConcernedOfTunbridgeWells I'm sure I'll need code gen at some point, but managed to avoid so far.
@ConcernedOfTunbridgeWells I'm pushing for dapper.net,. But they can use EF if they want
 
9:41 AM
@gbn It's quite useful if you want to perform some an operation that's tightly coupled to the schema. As an example I did a slowly changing dimension handler once that worked by generating the update and insert queries.
In this case, doing essentially the same thing to a dimension table that could have an arbitrary set of columns (although it did expect the system columns to be in a certain specific format).
One thing I like about ORMs is they really force a well behaved database, although they tend to be a 98% solution where you still need to drop out to custom SQL for some operations.
Dapper.net uses templating - quite a nice approach.
 
gbn
@ConcernedOfTunbridgeWells yes.
I'm no longer a fan of having procs all over. Use when needed for complex/critical stuff. Or avoid multiple calls
 
@gbn Yes. It's better to use some custom SQL code for stuff where the ORM doesn't really suit (large batch jobs, complex searches and suchlike) but you should be able to do the vast majority of queries on an operational system through an ORM.
Other situations like distributed transactions if your ORM doesn't support that (or all the targets) properly.
 
There's nothing wrong with using EF, you just have to expect you'll run in to gotchas shortly after hitting production - I did :)
Sometimes EF smokes crack then queries the DB
 
@gbn While I was still in the Brentwood office at my current gig I did quite a lot of maintenance work on a system that had been built on a whole pile of layered views. I think 'encapsulation' has failed when you spend most of your time digging through the views to find where something is calculated.
 
9:57 AM
that stops being encapsulation and becomes obfuscation instead
 
Hello
 
goddamn logitech's website is a useless piece of shit. it shows me the exact piece of hardware I'm after when I google it (logitech g13), but when I click on the link I get redirected to a local site that can't find the g13
(naturally, straight after complaining about it I figure out I want the second link from google not the first)
 
Could you take a look at my question please dba.stackexchange.com/questions/13071/…
 
Please don't do that. People will look at and answer the question in their own time, poking the chat room denizens just makes them antsy. :)
 
Hehe
 
10:07 AM
morning chaps
 
Morning bro
 
@user791022 I looked at your Q earlier. It's not a 5 minute answer so don't expect many responses quickly. It is well written though so I've +1'd it :)
 
thanks
I thought I made a mistake for too lengthy :/
 
Not at all. The regulars appreciate effort being put into a Q
 
cool :)
 
10:16 AM
to be bluntly honest my eyes glazed over about halfway through
although that could be something to do with working 29 hours in 2 and a half days
(a question of that length is a good thing though. +1 for effort)
 
Thanks :)
My english is not that good but I hope it make sense
 
it makes sense
that said your design is probably going to cause you some problems - the only problem is I don't know the answer :v
 
Oh O_o
 
gbn
10:36 AM
Sybase ASA
this other room is failing already
 
it's probably better suited for here than SO, that said I don't know if we have any ASA experts around
ASA is an entirely different beast from ASE, which is ironic considering how close the acronyms are
 
11:00 AM
@user791022 From your question it looks you want a cash matching system to track payments against invoiced amounts (and presumably credit control reporting so you can chase unpaid invoices).
 
Via BACS?
 
@user791022 Doesn't matter how you get the payment. You have the matching process that matches the cash payment record to the invoice.
The payment reference could be a cheque reference, a BACS payment reference, a USM transaction, a credit card payment reference etc.
If it comes with a resolvable invoice reference then you can match automatically, or drop out to a manual process if it's ambiguous. If you do have a manual exception process than wrapping it in some sort of workflow would help as well.
When I say manual I mean that the application can still do the matching, but requires the user to enter in the matching data.
 
I think at this point it will be manual process and maybe in the future I will look into automatic process thing.
 
@user791022 Are you comfortable you understand what I described in the answer?
 
I think I do.
When I sent the invoice to the companies and if they owe me money, it will say somethign like this on the invoice "You should pay on account - sort code: 301411 acc. no: 00110310 last paydate: 21/08-10"
 
11:14 AM
@user791022 OK. Leave some comments on the answer if you want me to clarify something. The answer gives a brief synopsis of how cash matching systems I've worked on work. You can do payments in both directions and overall balances with this midel.
@user791022 So a record of the invoice goes into the invoices table and a 'receivable' record goes into the allocations table.
When you get paid then you enter a cash payment record that records the BACS transaction. The operator then enters one or more payment records into the allocations table linking the cash payment record to the invoice (or invoices) it is matched to, and the amounts allocated against each invoice.
 
I think I understand what you mean, It would help you can post the tables and the sample.
 
11:44 AM
@user791022 I've posted a basic cash matching schema with a couple of scenarios and an aged debt query. Unfortunatley I don't have a running mysql instance to hand so I did it on SQL Server.
 
Really nice, I understand it well from your example.
CashPayment table can be both for reciving payment and sending payment?
 
@user791022 Yes. And, using this schema the aged debt reporting can take the overall balance into account if you group by customer rather than invoice.
Just make sure that the signs of the amounts on the outgoing and incoming invoices and payments are correct.
Note that I haven't put the customer into this schema, but if you imagine a 1:M relationship between customers and invoices, you can group by the customer ID or the invoice reference. Grouping by the customer ID would get you the overall balance for the customer, grouping by the invoice would give you the outstanding invoices.
 
Yep, I am going to add this into mysql now, I will get back to you if I have any question. Really thanks for your time.
It between companies and invoices.
invoices are calculated from the orders table
 
@user791022 As long as you can link the customer to the invoice - either directly or through the order doesn't really matter.
 
12:03 PM
It will be generating invoices every 2 weeks using Cron Job (time-based job scheduler). It will check through the orders table (to calculate it) and add into invoice table. Let say invoices has been generated and then I need to make some changes in the orders or orders_product table - it will have update Invoice.Amount field?
That is a bit of headache.
 
@user791022 If you've already issued an invoice you will really want to issue an additional invoice for accounting purposes. Once you get into working with money you want to run the system like a set accounts and build it so it's easy to audit. Post additional adjustment transactions and issue new invoices.
 
Ahhh I see
 
 
2 hours later…
2:00 PM
@ConcernedOfTunbridgeWells You here?
 
2:26 PM
14
Q: SQL Server: Difference between PARTITION BY and GROUP BY

Mike MooneyI've been using GROUP BY for all types of aggregate queries over the years. Recently, I've been reverse-engineering some code that uses PARTITION BY to perform aggregations. In reading through all the documentation I can find about PARTITION BY, it sounds a lot like GROUP BY, maybe with a littl...

just so you know...
 
JNK
yeah it'll keep happening
we need to get the name fixed ASAP
Can we not just call it Database.stackexchange?
or Datawhores or something
what can we do to expedite the name change?
 
gbn
@JNK That'll do, Less prejudiced than "monkeys"
 
@user791022 You rang?
 
JNK
Or "Data Badasses" and we keep the current name ;)
 
@gbn 'Database Apes' would shorten to dba.
 
2:39 PM
@ConcernedOfTunbridgeWells Indeed :) I was gonna say I have managed to translate your SQL example into MySQL. I went through and I understood it well now.
 
@user791022 Put it in an answer on your question.
 
JNK
@user791022 some might say that MySQL is SQL....
in a non-relational sense
 
MSSQL?
 
@JNK Probably meant SQL Server, because that was what I had available to do the example on.
@JNK Now, now - MySQL does actually have a join operator.
 
2:41 PM
morn all
 
howdy!
 
gbn
'lo
 
Hello DTest
 
@JNK Also has FK's...assuming the right engine
 
gbn
2:45 PM
@DTest Showing off now, eh?
 
@gbn I've got to take what I can get.
 
@DTest Could be worse, you know. Could be Oracle Warehouse Builder.
ETL Tool (n): a cunning device invented by I.T. vendors to neutralise the capabilities of an otherwise powerful and effective database management system.
 
@ConcernedOfTunbridgeWells I have replied to your answer.
 
JNK
@DTest I love that actually having it work like a relational database is essentially OPTIONAL
 
@JNK luckily it's getting better. I'm wondering if 5.6 will see the death of MyISAM...or will it wait for 5.7.
 
gbn
3:03 PM
@DTest 5.6 is looking better,
 
@DTest Better MySQL than NoSQL then?
:)
 
@ConcernedOfTunbridgeWells Depends on the job. Better MySQL than paying much cash for licensing on a small budget :) I'm not going to bash NoSQL in general
 
Well, I have been known to recommend BerkleyDB over MySQL for a job where the client had to integrate usage based billing from a Squid proxy into an antedelluvian photocopier card charging system.
 
What SQL server does Facebook use?
 
mysql
 
3:29 PM
A university. The vendor was crowing about how they could make 200,000 SOAP requests per minute on their interface, but (given that I essentially grew up in a university) I knew that would go down like a bucket of cold sick with the sysadmins at a place like that, who tend to be old-school unix geeks.
 
with some nosql implementation
it's actually an extremely hacked version of MySQL that fixes the issues they come across in their enormous use-case
@ConcernedOfTunbridgeWells interesting...how long ago?
 
@DTest 2003-ish.
Maybe 2004.
 
heh. today, what recommendation would you give them?
 
Essentially the correct architecture for that would have been to run a sub-process off Squid (Squid has an API for this) that interrogated the BerkeleyDB database for the billing information, and a batched process that polled the photocopy card database for any payments and wrote them into the BerkeleyDB store.
@DTest Actually, the same, I think.
Unless they moved to a different proxy server.
Chances are it's the same crusty old unix geeks running the show. :)
 
hehe
 
3:33 PM
What geeks mean to you? :)
 
@user791022 'Unix Geek' is a slang term for someone who's an expert or otherwise habitual user of Unix. It can range from being perjorative to a badge of pride depending on who's using it.
 
gbn
@user791022 not one you can download I'm sure
 
The cool thing about Facebook is as they come across performance issues that they fix, they submit bug reports to MySQL with their implementation.
 
I consider myself mid geeks and great social life
 
@user791022 Where are you from?
 
3:35 PM
Percona does similar, and works FB changes into their offering.
 
England
You?
 
New Zealand, but living in England.
 
Nice, where about?
 
Are you a native English speaker? - your idiom suggests it's not your first language.
@user791022 I live near Ascot and currently I'm working in Bournemouth.
 
Unrelated, but thought I should share: a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/…
 
@ConcernedOfTunbridgeWells my first language is BSL
 
British Sign Language
 
OK. Slightly different grammar to English, I presume.
I do remember being told sign language has some context sensitivities pecular to its visual nature, like associating particular places with ownership. You sign something identifying a particular space as relating to a person, and then signing other things in that place assoicates them as being owned by that person. Is that correct?
 
Well most deaf people are not good with English. They sign in English but every single word like you speak.
 
@user791022 Well, it's all chat here. Sorry for outing you if you didn't want that.
 
@ConcernedOfTunbridgeWells Nah I dont think that true.
@ConcernedOfTunbridgeWells its cool, ask me anything you want.
 
@user791022 Sorry, don't understand.
 
What didnt you understand
 
3:50 PM
Nah I dont think that true.
 
@gbn I enjoyed the initial rant on Sean Penn's poiltical maturity :)
 
gbn
@DTest Give SoCal back to the Mexicans, perhaps?
 
i thought we already did
 
gbn
It's interesting for me, I've been to the Falkland Islands. Seen the wrecks, graves, memorials and minefields,
It wasn't a voluntary visit
 
@ConcernedOfTunbridgeWells Deaf people in the UK usually socialise with the deaf community.
 
3:54 PM
@user791022 I meant that we're chatting in this forum and whether or not you're deaf really doesn't matter in a written medium.
 
Yep, it doesn't matter at all.
:)
 
@gbn didn't mean to imply the rest of the article wasn't interesting.
 
@gbn Something to do with your previous job?
 
"yet Denmark still owns them and Denmark is over 600 miles away"...still within the reach of Texas :)
 
gbn
3:57 PM
@ConcernedOfTunbridgeWells on my LinkedIn
When they sent me, I hadn't fixed radar kit for over 9 years. I didn't even program it. I was onto databases then
 
Firewall blocks LinkedIn. Bugger.
 
gbn
ah
 
@ConcernedOfTunbridgeWells Don't want you networking at work? Surprised they haven't blocked *.SE sites
 
@gbn One of the joys of working for a business that needs external contractors for intelligence.
@DTest Probably some sort of blanket policy about social networking sites. Often these outfits buy in their firewall policies from third parites and just select tick boxes of categories of stuff to block.
 
@ConcernedOfTunbridgeWells I am doing a quick UI prototype now to relate to that invoice table designs..
 
4:02 PM
@user791022 Best of luck. Wish you success with your application.
Never seen anyone that blocked Slashdot, The Register, SO or reddit, though. Methinks you can see the hand of the I.T. department in that.
 
hah
 
@ConcernedOfTunbridgeWells Thanks :)
I always on Slashdot
 
@user791022 We're always happy to talk shite here.
@gbn even made a room to move the moderation chat into so we could keep this one clear for talking shite.
 
@ConcernedOfTunbridgeWells Slashdot comments are worse
too much trash talk
 
@user791022 Talking shite != trash talk.
Talking shite is what we do here - also known as 'bollocks' in some circles.
 
4:14 PM
Additionally, if you lot want something to do to help pass the time, go find five unanswered questions and either edit the answers, upvote the answers, or go provide new answers.
we currently show 316 unanswered Q on dba.se
 
gbn
@jcolebrand I flagged a load in t'other room for more VtCs
 
4:49 PM
@gbn I know you know the answer to my question:
1
Q: What's the difference between a CTE and a Temp Table?

RachelWhat is the difference between a Common Table Expression (CTE) and a temp table? And when should I use one over the other? CTE WITH cte (Column1, Column2, Column3) AS ( SELECT Column1, Column2, Column3 FROM SomeTable ) SELECT * FROM cte Temp Table SELECT Column1, Column2, Column3 IN...

 
@Rachel there's you a bare bones answer.
let's see if I can make it better
 
cte's are re-evaluated every time they're referenced? I was not aware of that.... are they evaluated once upon creation too?
 
JNK
detailed(ish) answer posted
 
@Rachel I always thought of them more like views than temp tables
Except the perm. definition part
 
@Rachel well, once per script block, like I said, I'm rebuilding my answer
 
4:56 PM
Huh, so they're more like storing a query, and it inserts that stored query into your main query anytime you reference it?
 
JNK
they are basically disposable views
that persist for the next query ONLY
added a caveat too, which is NEVER USE THEM FOR PERFORMANCE REASONS
people here have been doing that a lot and it makes me nuts
 
@Rachel that's certainly how I use them
 
I recently found out about them
 
JNK
they are cool
 
@Rachel Yes, they're an abstraction mechanism. They can also be parameterised and called recursively.
 
JNK
4:57 PM
i almost always use them just to simplify something or for recursion
if you need to do recursion its the best way to handle it
 
I use them to sort crap out, I've usually used them to partition over rows to sample data/ect
 
JNK
since your alternatives are essentially loops
 
@BenBrocka that's what I do too
 
JNK
yeah good for that too
 
I'm looking at a query now where I need to pull a bunch of calculated data, then run calculations on the calculated data. The query was very messy, but I wasn't sure if I should use a temp table or a cte
 
JNK
4:59 PM
temp table
without a doubt
unless you are only looking at like 100 rows or something
 
Naah it's more than that. I'm going with a temp table, but am glad I asked the question and learned more about them :)
 
Yep, temp table or you'll probably be rerunning the calculations tons of times
 
JNK
the biggest diff to me is you can't index a cte
or refer to it more than one query
i work with some folks who are determined to use them as much as possible
 
I have issues with the fact it actually re-runs the query. I thought it cached the results
 
JNK
which leads to some "interesting" design patterns
like 4 or 5 CTEs deep
 
5:00 PM
wait, so you guys love @ConcernedOfTunbridgeWells more than me? I see how this is. :p
 
@JNK it's CTEs all the way down
 
@jcolebrand To be fair, you only updated your answer like... 48 seconds ago
 
@BenBrocka LOGO LOGO LOGO
 
JNK
;WITH Cte1 AS (...), CTE2 as (... from CTE1), CTE3 as (... FROM CTE2), CTE4 as (... FROM CTE3)...
 
@Rachel psssh
but I do like JNKs answer
 
5:02 PM
Me too, its easy to read than your wall of text
 
@JNK now run that puppy in a cursor
 
@JNK stats worth mentioning in that answer possibly
 
@JNK wins the internetz (for CTE vs temp table)
 
JNK
@MarkStoreySmith adding now
 
@JNK forgot about indexes, I rarely deal with sets/operations complicated enough I need temp tables let alone indexed ones
In fact I think I removed the only temp tables our web app used because they were incredibly stupid, basically they joined 5 temp tables instead of running 5 subqueries (which, when written properly, were two subqueries)
 
JNK
5:04 PM
All these things are just tools, and prone to abuse like any other tool
 
Anyways, thanks for your answers :)
 
JNK
you can hammer a nail with a wrench, or drive a screw in with a pair of pliers, but it doesn't mean its a good idea
 
@Rachel at least I gave links ;-)
 
JNK
lol
* upvotes jcole out of pity *
2
 
lmao
yay pity votes
 
5:07 PM
@jcolebrand If I upvote you will will you stop hassling us for talking bollocks in the chat room? :-}
 
@jcolebrand True, but I can find MSDN links on my own. Understanding them is another issue :)
 
@JNK I wasn't saying it was a logical implementation :)
I honestly wonder how the hell he came up with the idea
 
@ConcernedOfTunbridgeWells wait, who did I harrass?
@Rachel sshhhhhh, don't give away my sekrets
 
He made 5 temp tables, each one was just a single key + column pair
 
54 mins ago, by jcolebrand
Additionally, if you lot want something to do to help pass the time, go find five unanswered questions and either edit the answers, upvote the answers, or go provide new answers.
 
5:08 PM
but that's not harrassment
 
Pfft I love the chat in your chat rooms. It's a nice break from work
 
He could have just used 1 temp table with 5 columns + the key. Still no reason for the temp table (did I mention each temp table contained at most one row?) but still
 
that's just being a good modrater
 
@jcolebrand Not if it's done in moderation ;)
 
with the added excuse of "but I'm getting advice from some experts"
 
5:09 PM
@ConcernedOfTunbridgeWells twice is moderation ;-)
 
@Rachel Don't know about you, but I'm just talking shite.
 
I don't think I will ever take anything said in this chat room seriously :)
 
@Rachel Now you're getting the idea :)
 
Firewall .. bugger.
 
5:11 PM
 
@BenBrocka You're a scholar and a gent.
 
@ConcernedOfTunbridgeWells Hope they're paying you well enough to be worth their firewall shenanigans!
 
@DTest If they actually monitored it I'm sure they'd have given me the boot by now.
 
Our firewall isn't bad, but it's blocked some very random sites
Like the W3C
 
I would have insisted on a free firewall pass as part of my contract....
probably why I don't consult :)
 
5:13 PM
@DTest It's a pain - usually takes months to get all the permissions I actually need to do my job.
I think I.T. policy in these outfits has a fair dollop of security theatre. Never yet seen a corporate firewall that could prevent me from getting a C compiler onto the machine.
In this case I only had to ask and they installed Visual Studio :)
 
"Save yourself the headache. I need access to the internet to properly perform my consulting function. If this isn't possible, my rate is now rate*300%."
 
We have a firewall here but I got given a login to bypass it :)
I couldn't live my life without internet
or at very least, wouldn't be a very effective employee at my current job
 
01:00 - 18:0018:00 - 00:00

« first day (407 days earlier)      last day (4462 days later) »