« first day (2188 days earlier)      last day (2696 days later) » 

12:56 AM
--Approach 1: The all in one WTF
--  Advantage: 1 step and no temp junk created
--  so safe to nest into other subqueries and reuse
--- Disadvantage: Messy to read,
--      could be slow for large sets,
--      and relies on a primary key
SELECT row_number, oldtable.*
FROM (SELECT * FROM people) As oldtable
CROSS JOIN (SELECT ARRAY(SELECT name_id
        FROM people
        ORDER BY last_name, first_name) As id)  AS oldids
CROSS JOIN generate_series(1, (SELECT COUNT(*)
                    FROM people)) AS row_number
So gorgeous
 
 
4 hours later…
4:50 AM
@MaxVernon The answer is in:
55
A: Unexpected scans during delete operation using WHERE IN

Paul White "I'm more wondering why the query optimizer would ever use the plan it currently does." To put it another way, the question is why the following plan looks cheapest to the optimizer, compared with the alternatives (of which there are many). The inner side of the join is essentially runnin...

@Lamak Ha ha that's awesome!
 
5:03 AM
@PaulWhite - thanks. I figured it was something about row goals and maybe plan costing, but with only 4 rows in each table I expected that to not play into it. Perhaps I'm misunderstanding. Don't worry about spending any more time on it!
 
@MaxVernon Ok, to summarize: the optimizer introduces a group by (and lazy spool) to speed up testing for matches (fewer rows to check each time). After that, it notices that the group by key is an outer reference if the anti semi join is implemented as an apply (correlated loop join), so the GbAgg can be replaced with a Top. That's where the Top comes from, it's not about finding one row; the (a)sj does that already.
Or put it this way: if you go looking for matches (or non-matches) in a table more than once, it might pay off to group by (distinct) the potentially matching values first, so each check has to test fewer rows.
 
5:24 AM
@PaulWhite aaaahhhhhhhh.
 
If I get time later (it's NYE so maybe not) I might put a Q & A up for it. It does come up quite often.
 
Yes, happy new years eve, and have a fantastic 2017!
 
Cheers you too. Less than 6 hours of 2016 remain!
 
 
4 hours later…
9:47 AM
Yes, +1. StockUpdated is either a datetime or a timestamp and not a date as the "weird results" conclusion assumes. The results only prove that that there are exactly (33098-24446)=8652 rows that are > '2016-12-30' and < '2017-01-01', so as this answer says, have a time other than 00:00:00. — TypoCubeᵀᴹ 23 mins ago
Is @MikaelEriksson into mysql now? ;)
 
10:05 AM
@TypoCubeᵀᴹ In my defense the question was not tagged when I answered. Have to admit the ticks around column an table names did not feel quite right :).
 
You are assigned as our temporary mysql expert. Seems like a title that many want to avoid!
Aug 3 '15 at 9:02, by Andriy M
@ypercube Actually I wanted to stop pretending to be a MySQL expert :)
Sep 30 at 9:51, by profile 101
@TomV i am php-mysql expert :-) just kidding.....
Nov 25 at 8:45, by Philᵀᴹ
@ypercubeᵀᴹ is a MySQL expert, for example
Dec 19 at 10:12, by Paul White
@TypoCubeᵀᴹ That's fine. I'm happy to wait for our MySQL expert (Phil) to return.
 
10:54 AM
@TypoCubeᵀᴹ Isn't everyone?
5 minutes 30 seconds to 2017
Happy New Year!
 
@PaulWhite I assign "everyone" to be our resident mysql expert!
 
11:39 AM
That's decided then :)
 
11:54 AM
@TypoCubeᵀᴹ Reminds me of this (and I think there were a couple of similar others in the series)
 
 
1 hour later…
 
1 hour later…
2:17 PM
@PaulWhite Happy New Year! Did you get your new year hat yet???
 
@bluefeet No I didn't :(
 
@PaulWhite have a star and you should get it now
 
@bluefeet Thanks! My earlier message might have been a second early for UTC-12?
 
Happy New Year Heapers!
6
@PaulWhite possibly
 
happy New Year
@PaulWhite more like an hour early it was
 
2:22 PM
@TypoCubeᵀᴹ Oh it's +13 in summer yes.
Time zones. Urgh.
 
they are the worst
 
Hat acquired!
I'm going to miss hats when they're gone.
 
@PaulWhite I am just lucky to be in UTC half of the time.
 
@TypoCubeᵀᴹ Move to Iceland and you can have UTC all year round!
 
3:12 PM
Not a word you see very often! (Defenestrate)
1
A: SQL Server - Uniqueness Of The Transaction ID

Sean Gallardy So, how can I get such a unique id for a transaction in the transaction logs? Stop trying to use the transaction log for these types of situations. Take any notion you have of using the log for data mining and defenestrate it. Or should I use SQL server audit? Is there a way to query the...

 
So we got the 2017 hat for second time, hopefully for longer ;)
 
 
2 hours later…
4:58 PM
Well, here in Jakarta there are many, many fireworks displays going off all at once.
 
5:58 PM
@ConcernedOfTunbridgeWells Enjoy them wearing the 2017 hat ;)
 
6:24 PM
windows auth needs a pam plugin
what a pita
 

« first day (2188 days earlier)      last day (2696 days later) »