« first day (1695 days earlier)      last day (3176 days later) » 

1:39 AM
Should my last edit to my question have been an answer instead? dba.stackexchange.com/q/112173/72091
 
@TomV Thanks for the reply on the question. The link was more about getting him to add detail, and get a feel for what a good question would look like, but I take your point :) Deleted my comment, added a new one.
@Erik Looks OK to me, though the question could use a little more description before the code, just to give people a clearer idea of what you mean by 'next n' rows, and also what the context is.
 
Ok I'll add some more description/context.
@PaulWhite Thanks for looking at it for me.
 
@PaulWhite Dear God man, it's 02:50 in the morning in NZ - do you ever sleep?
 
@Vérace It's 13:48 Wednesday :)
 
@PaulWhite Although, I have seen you answering at (what would be) strange times (for NZ!).
 
1:49 AM
@Vérace LOL!
Current view from my window.
@Vérace Yes, on any other day, you might well have been right :)
 
@PaulWhite What's the temperature?
 
@Vérace Still winter here (5 more days!) so 16C / 61F
 
@PaulWhite Check this out met.ie - how does one emigrate to NZ?
 
@Vérace That seems unusually wet/cold. Has it not been a good summer?
I've watched some Cricket from England over the past few months and the weather seemed OK for the most part, even hot on a couple of occasions.
Pictures etc. of Ireland look beautiful, especially Éire.
 
@PaulWhite In a word - no! If ther've been more than 5 days over 20C this summer, I'd be surprised. Also, England != Ireland. And that's Éire - note the fada - or long accent - over the E. Eeh-ruh - not Eh-ruh. Without the accent, the word means encumbrance - which the English have always found us to be! :-)
 
2:00 AM
@Vérace Yes it's just too hard to type without opening charmap :)
Now you've typed it, I can edit copy paste :)
 
@PaulWhite Try finding it on a PC-BSD box! So far, I've installed MySQL and PostgreSQL - I'm going to do Firebird and SQLite next. I'm a mature student and this is all for a College project.
 
@PaulWhite You're a lucky man to have such a nice view out your window.
I've updated my question to have more context and a better intro. Let me know if there is more I should do.... dba.stackexchange.com/q/112173/72091
@Vérace I've been wondering for a while, what is your profile pic? Is it some kind of magnified parasitic worm?
 
2:27 AM
@Erik It's Caenorhabditis elegans - a nematode (round) worm used in molecular biology (my true love!) research. My handle means "truthful" in English (it's a French word), but it can also mean (in a roundabout way) "l'ace des vers" which is the "ace of worms" - also in French.
4
 
@Vérace Very fun. I took French in High School but I didn't make it to a French speaking country until 8+ years later. I know C'est vrai. (It's true) but I wouldn't have made the connection with Vérace
 
@Erik C'est dommage (pity) - lived in Paris for a few years - did Masters there. Revelation to live in a different country and language!
 
That is very true. My wife is Peruvian so I've spent a great deal of time in Peru and South America in general. I've often thought that I should have studied one of the other two languages my High School offered (Spanish and Japanese) since both would have been useful quicker, but as the saying goes... C'est la vie, non?
 
Press the up-arrow (↑) key on your keyboard to edit. Limited to a few minutes.
 
I don't see an up arrow just a down one; nevermind it is in the popup, but my older posts don't seem to offer the ability to edit, just flag
 
2:38 AM
@Erik Oui mon cher, c'est la vie! - C. elegans is the first (only) eucaryote to have its genome completely sequenced. Yeah, yeah, the human one was sequenced in 2003 - so they say! Anyway, thanks for your interest in my profile pic., but I'll be AFK for a while (even an insomniac's gotta sleep! :-) ).
 
That is a nice tip with the keyboard. Thanks for the tip.
@Vérace lol enjoy your rest
@PaulWhite dba.stackexchange.com/q/112188/72091 pretty clearly a homework question
Based on this meta post meta.dba.stackexchange.com/questions/490/… I didn't flag it.
 
@Erik Thanks for the heads-up.
 
Sure thing. I'll write a similar comment to yours (on the question not here) if I see anymore.
 
Sweet as.
 
can be.....
 
 
4 hours later…
6:33 AM
not sure what that was
 
6:44 AM
cat on the keyboard or something :)
 
7:02 AM
@PaulWhite Hmm, question is closed. I had an idea what he was asking and now my new comment is looking like a bad answer :)
 
@TomV Are you saying you want to add an answer?
@TomV Looks like a rage-quit delete. Commented for clarification.
 
@PaulWhite an exact answer would be hard, but I could expand my comment as an answer and I think it could be useful
in any case we would need more detail yes
 
@TomV Go nuts.
 
7:32 AM
there, posted
if you think the whole post is just bollocks I won't be offended if you delete it anyway
 
@TomV Does it make sense to keep your comment?
 
@PaulWhite not anymore, I deleted it
 
Hey guys quick question. I have a table that has licenses as a column. I want to obtain all the records of licenses "aaa" , "bbb", and "ccc". How do I do this again?
I can't seem to get this simple query for the life of me...
 
select * from table where... ?
 
Yeah I tried where license = "aaa", "bbb", "ccc"
 
7:40 AM
license in ('aaa','bbb','ccc') instead of =
 
As well as used ORs, but that only returns one row
oh okay
 
or's should work too
 
Thanks.
 
 
4 hours later…
12:01 PM
Good afternoon
 
Howdy
 
12:15 PM
Oh joy Log shipping restore is failing this morning.
 
JNK
@Zane LSN issue?
 
I can't even see the effing log.
 
JNK
the sql agent log?
 
Yeah.
I can't load the GD thing.
Times out if I load it though SSMS and if I use lightspeed it hangs the application.
 
JNK
hrm
You can probably query the table
 
12:43 PM
Well I queried my way to the message but they aren't very helpful lol
 
12:55 PM
All I'm getting from SQL and lightspeed is an error was recieved while reading backup file - Cancelling RESTORE LOG is terminating abnormally
The LSN's do match btw
Is it odd that it's still showing as restoring even though the restore job isn't currently running?
 
JNK
yeah that's weird
oh no
that's NORMAL
sorry
it'll always show restoring since it's in norecovery
that's how secondaries show until they are activated
so wait what was the error you got?
 
error was recieved while reading backup file - Cancelling RESTORE LOG is terminating abnormally
The sysjob history gives me an even better 04:02:13 - Restore transaction log failed.
 
1:13 PM
Have you tried a RESTORE VERIFYONLY? With checksums if it was created that way?
Also: is this manual log shipping, log shipping from the UI, or something LS-specific?
It's possible you have a corrupt log backup, in which case, fun.
 
1:39 PM
Is there anyone in channel that is not familiar with Ola's scripts? ola.hallengren.com
If so, and you are writing your own backup and index maintenance script - please stop.
Or look at the McCown's SQL Minion or Michelle Uffords script. Something, anything versus writing your own from scratch unless you have a specific use case that the above do not address
 
don't be so bossy @billinkc
 
can i get a boom boom
0
A: Optimizing join in vertica

Kermit The EXPLAIN shows NO STATISTICS. These need to be updated. Vertica will optimize the predicate in this case using SIP: Sideways Information Passing (SIP) has been effective in improving join performance by filtering data as early as possible in the plan. It can be thought of as an advanced ...

 
@bluefeet I said please...
 
@Kermit moob moob
@billinkc please don't be so bossy
 
2:21 PM
wow, just reading about the shooting in virginia
 
it's pretty awful
 
yeah, jeez
 
JNK
yep
 
yet again
 
@PaulWhite it's done through Light Speed
 
JNK
2:23 PM
everybody knows my feelings on this
so I'll stay out of it
 
@PaulWhite also no I have not.
 
not much to say @JNK it's just plain ridiculous
 
yeah, sorry for bringing the topic here, I was just kinda surprised
 
BRB need to drive in.
 
JNK
@billinkc sums it up nicely
"Deport 11 million people and build a 2,000 mile long wall? NO PROBLEM"
"Check to see if you're crazy before we let you buy a gun? IMPOSSIBLE!"
 
You managed to stay out for 20 minutes :P
 
I'm coffee for the room, always get the sh*t started
Not to be confused with JNK - The Sh*t [tm]
 
JNK
I tried
It's all Missourah's fault
 
@billinkc that's......so weirdly fitting
 
3:29 PM
How do I roll back a quasi pending edit? The only current answer dba.stackexchange.com/a/112234/72091 to my Windowing question had a major oversight in their view. I edited the answer to fix the view. Roughly 25 minutes ago mustaccio reviewed my edit and rejected it. Which is fine. The problem is the answer still shows as under review when I look at it, so I want to rollback my edit and add a comment explaining the answerer's oversight, as mustaccio requested.
 
@Erik It does look a bit too radical to me to go without a prior agreement with the author of the post. So you are fine with it being rejected?
 
@Erik Done.
 
Too late :)
 
lol (directed at the too late). I'm fine with it being rejected. I was just trying to help the author of the post. In the future I'll stick with guiding comments.
@PaulWhite Thanks for the rollback
 
This is butts.
 
4:15 PM
@Erik colorado, eh?
@JNK i'm on the fence here. both sides have legitimate points. the fact that firearms are so readily-accessible and defended here is absolutely bonkers. however, i also agree that if we take the guns away, we'll find other ways to kill each other. the HUGE problem is not checking to see if you're "crazy," it's how we handle mental illness in general. thanks ronnie.
 
JNK
@swasheck I disagree with the second point
This is a solved problem in pretty much every other country in the world
 
@JNK that's fair ...
 
@swasheck Yeah I'm in Longmont
 
JNK
There will always be violence, but the ubiquity of firearms makes it much more likely for those encounters to be fatal
 
@JNK ... is that because of gun control or mental health treatment?
 
JNK
4:23 PM
both
 
@JNK cheater
 
JNK
well we suck at both
 
completely agree
 
I think it's fair to say that if guns had never been invented, significantly fewer people would have been shot.
 
JNK
But murder rates are incredibly lower in say the UK
 
4:24 PM
@PaulWhite absolutely. but in america where rage is all the rage, what would happen to the rate of bludgeoning?
 
JNK
They actually have a crime rate like 3x the crime rate in the US
 
@swasheck We don't know. Shooting someone is relatively impersonal though. No direct contact.
 
JNK
but our homicide rate is 4x theirs
 
But your prison population is so much lower.
Oh, wait.
 
JNK
We have 10k murders a year with guns
 
4:26 PM
we should probably ban cars because more deaths are caused with car accidents
 
JNK
20k suicides and accidental deaths
@Erik nope, more guns kill people
in the us
 
totally fair and i agree with both of you to a certain extent. i just dont see gun control as solving the problem ... but addressing the symptom.
 
It's worth a shot (!)
 
JNK
@swasheck agreed, but current easy access just exacerbates
 
i'd be all about better gun control coordinated with a robust health (mental and otherwise) program
@JNK absolutely.
 
JNK
4:28 PM
a lot of it is cultural too, Americans want to be John Wayne or Clint Eastwood
and shooting guns is pretty fun
 
@JNK You're not wrong there.
I've only done it a handful of times but it is fun.
 
@Erik i'm in denver. you should come to our SQL Saturday on the 19th. http:\\denversqlsaturday.com
@Zane why is it fun, though?
 
Is that the 19th of September?
 
@JNK cdc.gov/nchs/fastats/accidental-injury.htm Reports 33k vs 20k that you mentioned
 
But you could go special places if you want to shoot guns for sport or fun. You don't need them at home or on your person in everyday life. (Constitution notwithstanding).
 
4:30 PM
@swasheck why is skipping rocks fun?
 
JNK
@Erik well you need to add in the 10k murders too
 
@Zane you missed it otherwise
 
JNK
and numbers for 2013 or 2014 guns passed cars
 
Just wait until lightsabers get invented.
 
God that's coming up quickly.
 
JNK
4:30 PM
that data's from 2011
 
@PaulWhite they've already been invented.
 
@PaulWhite speaking of ... floridiots have just allowed a gun range that serves alcohol
 
Just in a Galaxy far far away.
 
And cars very arguably have real benefits to society.
 
JNK
@Erik ALSO, its not a fair comparison
 
4:31 PM
@swasheck yup, read about it here too
 
@Zane I thought that was set in our future?
 
JNK
b/c of the utility of cars and also b/c of the rate of incidence per encounter
 
@PaulWhite a long time ago ...
 
JNK
average person here rides in a car like 4 times a day
 
@swasheck I really want to go. My wife's birthday in the 18th, so I haven't committed yet. That being said I'm 80% sure I can swing it.
 
4:32 PM
@swasheck True. Though the narrator could be from even further in our future.
 
curse you and your interpretive lens
 
anyway, there's the whole media situation too, they are all over this thing. There's even a first person video of the shooting. I don't have it in me to watch it though
 
@Erik ah.
 
JNK
@PaulWhite It's a galaxy far far away, so by the time light reaches us from that galaxy its in the future
even though the events themselves occurred in the past
 
@Lamak me either. my sister-in-law knew the cameraman
 
4:34 PM
@JNK True! Does require FTL travel for films though.
Which I am not opposed to.
 
JNK
Do they ever explicitly state they are FTL?
Could just be very high relativistic speeds
 
@swasheck the whole situation is just wrong
 
@JNK i think in the follow-up prequel
 
@JNK I just mean for the films themselves to get here while the events they recorded are still in our future.
 
JNK
@PaulWhite ohhhhhhhhhhhhhhh
 
4:35 PM
nerds
 
We're going to need Dr Streetmentioner in a moment
 
JNK
I meant the events took place in the past and we are just learning about them now
 
@JNK That works.
I think.
 
someone needs to gantt chart this mess
 
Shhhh, you'll summon a pm with such talk
 
4:37 PM
It just seems very unfair that some other civilization had lightsabers so long ago.
 
JNK
@billinkc Look into a mirror and say "Milestones!" three times
 
Ack!
 
Using real lazy loading allows you to both load by chunks and insert possible new entries at the top of the list. — user2955677 37 mins ago
Chunks are modern, pages are so y2k.
 
JNK
@PaulWhite I put all my chunks in the cloud
 
hopefully that doesnt get you into trouble
 
4:42 PM
@JNK I took a selfie with your cloud chunks in the background.
Using an "app".
 
JNK
@PaulWhite Don't post it on facebook, it's inappropriate content
 
Ha ha ha
 
4:59 PM
Okay guess I'm doing a full restore to my BCP environment.
Super nervous.
 
@Zane have fun storming the castle
 
What could possibly go wrong?
 
Lightspeed is causing me much grief.
 
@Zane Isn't backup compression built-in in your version?
 
@JNK and @PaulWhite I personally think both guns and cars have their uses and abuses. At the end of the day they are both tools that can be misused. That being said, I think we can all agree that no one's opinion is going to be changed today on chat regarding gun control, so I'm going to drop the subject. :)
 
5:08 PM
I can see the need for the public to have cars.
No doubt progress and technology will continue to make them safer.
Self-driving cars make sense to me, for example.
 
I really want to accept this answer (the view with snapshot isolation is the path I'm going to take) dba.stackexchange.com/a/112234/72091 but they keep making it worse
 
i prefer to travel by Great Eagle, personally
 
Well natch.
 
@swasheck lol don't we all
 
@Erik I haven't looked at the question in detail, been busy with other stuff. How does a view help exactly?
 
5:11 PM
views, when nested, are always faster.
 
Or is there a hidden brilliance to a view named the same as a TVF which inputs my variable?
 
Nope.
 
@swasheck That is GREAT advice............. (not really) lol
 
Typically, I would use careful indexing and an optimized LIMIT query to fetch the keys of the rows for the page, then the rows themselves. I also prefer an indexed view for counts, where possible.
 
JNK
@Erik totally understood
 
5:13 PM
just scrap it all and use mongo
 
@PaulWhite The view hides the ugliness so it looks cleaner. It doesn't really solve any structural problems the snapshot helps with the concurrency issues
 
Of course a specific solution would require specific table schemas.
@Erik Do you have time to describe the concurrency issue? What bad thing happens? Or should I just make time to read the question at some stage?
Typically, a count is only used to display the number of pages available.
 
Gah LightSpeed why can't you find this backup!
 
"Last" works well in many cases. As does dynamically adjusting for changes since the last fetch. It all rather depends on the details.
@Zane Because Quest.
 
RestoreVerify Only finds it so why can't the actual restore.
 
5:15 PM
@Zane because it's a giant steaming pile of turd. is this a 2005 instance? if not, WHY ARE YOU USING LITESPEED?
 
@swasheck because I don't get to decide these things.
They've probably been using it since 2005
 
One wouldn't want a DBA deciding how to administer the database. Anything could happen.
 
@PaulWhite Well I've been on the job for about 2 months.
 
cats and dogs living together
 
Plenty of time to re-architect the organization.
 
5:17 PM
@Zane all i hear are excuses
 
@PaulWhite lol reading the question helps ;) The bad things is I get duplicate rows on the client. If I'm on the second page my offset will be thrown off by an insert and I'll return a row that the client already has. I could ask the developer to filter that out but why make my life easier when I can make their life easier. :)
 
That's not really long enough to tell them how it ought to be done. Especially when my experience with lightspeed is hovering right around 0
 
@Erik I see. How does SNAPSHOT help though? Surely you wouldn't keep the same transaction open for the length of the client's interaction?
 
@Zane i came into an organization with litespeed
 
If you think it would be helpful I'll take a cue from you and mock up the full query and table structure on StackOverflow data with some sample data
 
5:19 PM
we no longer use it
 
@PaulWhite DBA's administrating databases is almost as dangerous as allowing smart people to make decisions......
 
It seems to be throwing a fit that the patch specified for the LDF is not valid. However I didn't fucking tell it to go there to begin with. That's not even the right drive.
 
@Erik Quite.
@Erik For me, a table schema would be sufficient. I don't think sample data is necessary unless there's some peculiarity only the data could show?
But I wouldn't be able to look at this seriously for 18 hours or so - I'm in Wellington city tomorrow.
 
@PaulWhite ok I'll add it to my question, and some of the LEFT JOINs I'm using for other aggregates too so you can see the whole picture. I appreciate the help.
 
EXEC master.dbo.xp_restore_verifyonly
@filename = 'N:\SQLBackup\CMOAR\CMOAR_Full_20150825.bak'
This finds the file.
exec master.dbo.xp_restore_automated @database = N'CMOAR' ,
@filename = N'N:\SQLBackup\CMOAR\CMOAR_Full_20150825.bak'
Doesn't. What the eff?
This product is really selling me on the idea that I shouldn't have it.
 
5:27 PM
Sympathy.
 
schadenfreude
 
I agree.
 
@Zane Is it possible that something unusual happened to the database during this log period, e.g. having a log file added? Have you tried FILELISTONLY/HEADERONLY? There must be something aside from LS being LS.
 
@Zane This would be really dumb but the first string isn't unicode and the second one is. I doubt that is the problem but it is the only help I can offer.
 
@PaulWhite it has something to do with it trying to dump the log to a drive that deosn't have the ldf that it's looking for.
 
5:41 PM
handwave these arent the ldfs youre looking for
 
Now why that's not there or why this has suddenly become a problem when the backup from 2 days ago apparently requires the same thing.
Sweet now I'm getting a new verification error.
I may not be a log shipping Guru or anything but at lease if we were using SQL native I could effing use the tools I know to figure this out.
The Verify is showing success now that I added the folder by the effing thing still won't restore.
With the most generic error message ever. God I'm frustrated.
49999 : User cancel on VDI transfer
Interesting.
Sorry I'm taking up the whol chat with this.
 
you should be
 
6:12 PM
@swasheck He should be taking the whole chat or be sorry?
 
yes
 
glad we cleared that misunderstanding
 
orange
 
6:36 PM
Right I'm out of here.
 
6:53 PM
Got it.
 
@Zane Ooo what was it? (as I was leaving!)
 
It was trying to restore to a drive I didn't want it to. There was to spot for Log files there.
LightSpeed up and decided that I should have log files on my N:Drive.
I finally figured out where to change that setting.
 
I'm having a dumb moment. Let's say I have two tables with datetime columns (because I do), with a one-to-many relationship. I want the first record from the many with the next most recent date from the one, but I'm stumped on the query and feeling really stupid right about now.
 
What's odd is that if you script it out I was going to M: which is where I want but it was splitting them across drives for some dumb reason.
 
Actually, disregard that thought. Think I came up with something.
 
7:19 PM
SELECT * FROM A INNER JOIN B ON A.key = B.key WHERE B.DateVal = (SELECT MAX(BI.DateVal) FROM BI WHERE BI.key = A.key);
I have no regard for your disregard
 
JNK
You can also use a CTE and ROW_NUMBER() for this
 
@JNK I used to use that approach until a kangaroo aficionado showed me that the correlated subquery would perform better for the data I was working with. And in find fashion, I just assume it's always going to be true
 
JNK
7:41 PM
@billinkc Hobbit aficionado I thought
 
Insufficient troll count with a hobbit reference
so meta
 
cave troll, or mountain troll?
 
fried chicken troll, the worst
 
eewwww
 
8:12 PM
@JNK I've always used CTE and PK instead of Row_Number() Was using Row_Number a joke I haven't gotten yet?
lol I guess the real joke would be to tell me it wasn't, and then I figured out the punchline when I was trying to use it.... :)
 
Both can be fine approaches. I used the row_number approach exclusively until I got to weird datasets and The Heap edumacted me about the correlated subquery approach
 
JNK
No I like ROW_NUMBER()
 
8:34 PM
@JNK windowing function pusher
 
JNK
I start you on ROW_NUMBER() then move you to the hard stuff
"Try SUM of these window aggregates! They'll have you OVER the moon!"
 
@JNK I'd be HAVING trouble there
 
 
2 hours later…
10:20 PM
Hi all, my coworker made a new database today
For anyone who doesn't recognise the image: en.wikipedia.org/wiki/Um_Bongo
It is like MongoDB but very juicy and it doesn't have any problems
 

« first day (1695 days earlier)      last day (3176 days later) »