« first day (2267 days earlier)      last day (2602 days later) » 

3:04 AM
Well, that turned out to be an unexpectedly eventful few days
 
 
3 hours later…
6:02 AM
What is the order of query execution in MySQL?
I know it is:
FROM clause
WHERE clause
SELECT clause
GROUP BY clause
HAVING clause
ORDER BY clause
But what is the position of JOIN in the above order?
 
6:17 AM
@MichaelGreen That's some great job!
@MoinuddinQuadri Technically, JOIN is part of the FROM clause, so I would expect it to be processed at roughly the same point.
 
@AndriyM Thank You!
 
@MichaelGreen Impressive. Most impressive.
@JackDouglas I thought it was a SQL Standard thing that eliminating nulls during aggregation should produce some sort of warning or message (which may be disabled). I'm not about to search through to find it though. Perhaps I imagined it !
@JackDouglas On the same question, second link in the answer dbfiddle.uk/… gives an error about an odd number of hex digits, FYI.
 
7:21 AM
@PaulWhite thanks I've cleaned up my mess :)
 
7:45 AM
@MoinuddinQuadri It's FROM -> WHERE -> GROUP BY -> SELECT -> HAVING -> ORDER BY actually in MySQL.
Although standard SQL has SELECT after HAVING in the logical order of evaluation.
 
8:09 AM
@MoinuddinQuadri and since the order for SELECT / HAVING matters only when there are window functions, I expect MySQL to switch that, too, when they implement them. MariaDB has.
See the error you get when you try to access (in HAVING) a computed value from SELECT): dbfiddle.uk/…
> Window function is allowed only in SELECT list and ORDER BY clause
 
@MichaelGreen congrats, looks impressive
 
8:48 AM
An interesting article on the state of RDBMS/NoSQL: xaprb.com/blog/defining-moments-in-database-history
 
9:07 AM
> Perhaps this is what makes Redis and MongoDB endure. I don’t know, but I am sure it’s part of what makes them a joy to use.
oh, the joy
also, having SQL amidst ... code is bad from a purist POV, but there are ways to solve this. And there is a reason why even some the NoSQL products use a SQL(-like) language.
 
I think that many people that bash SQL actually don't realise its power
 
They don't know the power of the Dark Side.
4
 
9:24 AM
@Philᵀᴹ well, this guy seems to be involved in good old RDBMS, too
this fact does little help understanding his point
 
 
2 hours later…
11:49 AM
-2
A: How to maintain MySQL performance at high concurrency

suevthis is shite it did not help at all.

 
12:40 PM
@dezso At least he put an 'e' on the end of 'shit' to stop it sounding so rude!
 
12:58 PM
SQL> exec dbms_random.initialize(108798);

PL/SQL procedure successfully completed.

SQL> select dbms_random.string('U',4) from DUAL;

DBMS_RANDOM.STRING('U',4)
-------------------------------

PHIL

SQL>
I am random!
 
@Philᵀᴹ how did you work out how to do that?
 
@Philᵀᴹ How does that work?
 
I'm random too! dbfiddle.uk/…
 
1:13 PM
@TomV Just a loop
FOR i IN 1..2000000
LOOP
dbms_random.initialize(i);

select dbms_random.string('U',4) into v from DUAL;

IF v='JACK' THEN
DBMS_OUTPUT.PUT_LINE('Jack is '||i);
RAISE_APPLICATION_ERROR(-20000,'Done');
END IF;

END LOOP;
 
busy day at work? :)
 
Just inspired by randomness :P
It popped up on my "On this day..." Facebook from 4 years ago. I must've been having a slow day then :-)
 
Sadly I don't think you can get DBMS_OUTPUT via OCI/PHP
but there is always another way: dbfiddle.uk/…
 
That's one predictable random function
 
1:27 PM
is it bad if I knew what that link would be before clicking on it?
 
I think the answer to that is random.
 
And just throwing it out there since this is Dynamics, have you raised a support ticket with them to address performance concerns around the query hint they wrote in? — sp_BlitzErik 19 mins ago
Ha Ha Ha Ha
 
I was hoping you'd see that.
 
I'm not sure I should answer that question
 
I was hoping you'd see that comment :)
I wonder why that question is tagged dax.
 
1:41 PM
Oh I know :)
 
Oh! "DAX 2009". Ha.
Reused TLAs will be the death of our industry.
 
Internally we have an initiative for developers to follow called "always on"
It's very confusing for a few people
 
@PaulWhite I think he needs to go slap a developer on the back of his head
 
@TomV we all do
 
Always On the back of the dev's head.
3
 
1:46 PM
I posted an attempt at an answer
 
@TomV Typo at "all he ECC"
 
man
it's like a foreign language
 
I would expect the FAST 1 row goal to result in a nested loops anyway, but I like developers who are explicit in their code
 
@PaulWhite DoI
 
I think I tried to answer one of those questions once
then after reading your answer on the same question I decided to skip them from now on
 
1:56 PM
The answer is almost always indexing. Proper indexing would remove the sort and allow that cursor plan to be dynamic.
FAST 1 can't really help if the whole set needs to be sorted.
 
@JoeObbish Seeing the queries posted should put most people off
 
@TomV For me the problem is "AX uses API_CURSOR behind the scenes." If I'm not even looking at the right query then I can't post a good answer...
 
Dynamics AX must be successful. They sponsor an F1 team. Amazing.
Who knew the road to riches is paved with API cursors.
 
@PaulWhite is it real?, or a joke about the FAST 1 hint?, can't tell
 
They really did sponsor an F1 team
Their cars performed like the product, they haven't won a single race
5
 
2:08 PM
they aren't using the FAST 1 then
 
The expression says it all.
 
Is he grimacing in the hopes he won't be recognised?
 
The car is on display in MSFT campus in Bellevue
 
He's just waiting for his query to finish, I think.
7
 
2:36 PM
Neat, my seed is 87540
exec dbms_random.initialize(87540);
select dbms_random.string('U',4) from DUAL;
 
@CadeRoux couldn't find mine
I just get an error:
> Internal Server Error

22P02ERROR: invalid input syntax for type json
DETAIL: The input string ended unexpectedly.
CONTEXT: JSON data, line 1:
maybe I'm not random
2
 
2:53 PM
@PaulWhite Maybe his buffer is empty
 
3:05 PM
@MichaelGreen well done, congrats
 
3:19 PM
exec dbms_random.initialize(565070);
select dbms_random.string('U', 5) from DUAL;
 
@CadeRoux oh, so you are saying I'm random too?
 
@Philᵀᴹ yes, like 'Could you please shut the f**k up?' is also polite enough
 
3:37 PM
The comment doesn't lie
2
 
Lol
 
@TomV Top marks for honesty in code review.
 
@dezso Waste treatment
 
@TomV I like rc_manure
3
 
That's going to remain amusing long after the context is lost.
 
3:46 PM
@TomV in this case my comment was not funny
1 message moved to Trash
 
@Lamak lol, not much randomness at all really.
I wonder if there are collisions for same seeds. I guess can insert the seeds and values into a table and see when there are dupes.
 
 
1 hour later…
5:14 PM
a message from the future:
0
Q: change server date postgresql

bentakayzeI have a postgresql db (v9.4) and its default year is 2026. Is there any way I can modify it? I have read about modifying the postgresql.conf file, but I have just found the timezone property.

 
It's a hint. PostgreSQL is the RDBMS of the future.
2
 
@AndriyM If select verion(); returned 19.3 I would be impressed!
 
5:31 PM
If select verion(); returned anything but an error, I would be impressed too. That would likely mean that @ypercubeᵀᴹ would be involved in the development of PostgreSQL ;)
2
 
6:00 PM
I just spilled a huge mug, full of coffee.
 
@ypercubeᵀᴹ in 2026, or the past?
2
 
1 message moved to Trash
 
1 message moved to Trash
 
6:33 PM
hello
 
Hallo @McNets =)
 
Hi Evans!
 
2 messages moved to Trash
 
6:53 PM
@JackDouglas see PM
 
@CadeRoux prime minister?
 
@Lamak private message/room
 
ah, no, I got it, I was just messing around
 
;-)
 
7:09 PM
I didn't know that this site had private rooms
thought everything was public
 
Maybe it is public, I just said make a room with this user.
 
@JoeObbish anything is possible in 2026!
 
@CadeRoux I think it is public. You just need the link
@CadeRoux yup, I just tested it (sorry for intruding the room, but I left already)
 
7:36 PM
@Lamak Project manager
 
that might be it
 
7:52 PM
this question should be closed, right?
0
Q: Can an Update Statement Select List contain more items than the Insert list?

johnnyI am getting an error on an Update statement that worked at one time. I don't know what broke. I am joining three tables for an Update in one of them. But SQL Server 2012 returns: System.Data.SqlClient.SqlException: The select list for the INSERT statement contains more items than the i...

 
8:04 PM
Yes, I voted to close as too localized, specific bug not of general interest.
 
thanks
 
I don't think that question should be closed.
I think @Lamak should answer it and that answer should be marked as a chosen.
But, then again I'm not sure anyone is going to be able to find that question with such a poor title and error message. So maybe the reply value of it isn't there.
But that's a super crap message from SQL Server.
 
@EvanCarroll that's why I'm hesitant on answering. Too specific
 
I'm not sure how PostgreSQL handles that for comparison, but I would hope that an error in a trigger at least indicates the statement that triggered the trigger so to speak.
 
@EvanCarroll you could test it
I'm wondering now how postgreSQL handles it
 
8:11 PM
hold on. I'll tell ya =) Let me look for a dupe here first. That sounds more useful.
I'd find it hard to believe this is orig.
 
@EvanCarroll yeah, the problem is with the question title, makes it kinda hard to find a duplicate I think
 
yep, I give up =( it may be orig
 
@EvanCarroll doubt it, just hard to find, because the real error (a problem with a trigger) is kinda hidden
 
well, again, that's just a stooppiddd error message.
It's like the trigger doesn't get context.
 
@EvanCarroll yup
that's why I'm waiting for your test
 
8:19 PM
ah, distracted one sec =( I'll do it though promise.
Coffee and phone arguments now
 
There were certainly other details of the error sent by the server along with the message, which the OP either couldn't see or didn't notice, such as the name of the module where the error occurred (which in this case would be the trigger name). But I'm not sure if the statement that invoked the trigger in that instance would be referenced in the details.
 
@EvanCarroll no prob. I can wait
 
Well, if it showed the trigger name than the OP is being deceptive or outright stupid.
That's all you should expect.
 
The message is prefaced with System.Data.SqlClient.SqlException, so he's probably getting it in an .NET application (possibly his application), but without retrieving details, only showing the message. When I see an error of this kind in SSMS, I also always see where it has occurred. So this may additionally be a matter of (lack of) communication (between the app and the server).
 
@EvanCarroll not any better by the looks: dbfiddle.uk/…
at least it shows the insert statement I suppose but no clue that it's in a trigger context
I guess you should know it couldn't be anything else if it is executing a function. Unless it's a RULE or something like that?
 
8:29 PM
@JackDouglas interesting
 
QUERY: INSERT INTO bar (b) VALUES (1)
CONTEXT: PL/pgSQL function mytriggaz() line 3 at SQL statement
Oh @JackDouglas beat me to the punch.
So PostgreSQL only tells you the name of the trigger.
But at least it tells you the name of the trigger, and that it's a trigger. That much would matter for the OP.
 
@EvanCarroll it does?
where?
ah, I see now
don't mind me
 
Yea. So the idea situation here is the name of the trigger, and the context it was called in. Neither database shows the context, PostgreSQL though shows the name of the trigger.
 
but what happens if the trigger is just the INSERT?, and it doesn't call a function?
@EvanCarroll but is it the name of the trigger or the name of the function that inserts data?
@EvanCarroll can the trigger be just: INSERT INTO ....?...what would happen then?
 
I'm not sure I understand?
 
8:37 PM
I suppose the reason for not showing "context" is that context could be a trigger, from another trigger, from another trigger, form a cascade action, from another trigger from a statement. What should be shown?
 
This trigger does just insert. or mine did
 
@EvanCarroll I don't understand myself either
 
@ypercubeᵀᴹ the stack trace, if it's maintained anywhere. I assume it is.
 
@EvanCarroll I don't really know postgreSQL, so I'm really asking. But, in @JackDouglas's example, the trigger calls a function that inserts data, right?
 
yes, that is correct.
 
8:39 PM
can you have a trigger that doesn't call a function, but just does: INSERT INTO ......?
 
@Lamak a trigger in Postgres always executes a function
 
oh no. I see what you're asking.
 
@ypercubeᵀᴹ I see
 
So in PostgreSQL, a trigger is implemented as a special function that returns a trigger. That special function is set to fire using the CREATE TRIGGER DDL.
 
@EvanCarroll yup, I get it now
thanks
 
8:41 PM
it's probably also noting you can write triggers in v8.
which I find to be awesome.
 
@EvanCarroll it does sound awesome
 
Making things sound awesome is a skill in its own right.
 
It's not totally awesome. It's just near-awesome.
Totally awesome would be if the author wasn't such an ideologue and published plv8u.
Then it'd be totally awesome.
Instead we have trusted plv8 which brings the power of v8/crankshaft and obscenely optimized javascript to the database but denies us the ability to use NPM.
Totally awesome though is plperlu, which brings me the power of CPAN to triggers. So you can finally write an event driven FTP server in SQL. postgresql.org/docs/current/static/plperl-triggers.html
 
8:59 PM
NPM. Urgh. Vomit
 
Think of like a most nuget with more packages and higher code quality.
 
NPM is poor. Just look at the dependencies that get pulled down by some stuff, and what those actually do
 
everyone knows about that. It's been resolved.
can no longer unpublish packages 24 hours after publishing them
 
Still, an entire module for 11 lines of code
 
Think, we could just repeat those 11 lines everywhere! That'd be great.
 
9:12 PM
Quote from a follow up article: ""I get the impression that the NPM ecosystem participants have created a fetish for micro-packages," Haney noted. "Rather than write any functions or code, it seems that they prefer to depend on something that someone else has written ... In my opinion, if you cannot write a left-pad, is-positive-integer, or isArray function in five minutes flat (including the time you spend Googling), then you don’t actually know how to code."
 
Who wants to waste 5 minutes writing that stuff anyway when libraries provide it?
I frequently use lpad in underscore in es5 code, gabceb.github.io/underscore.string.site/#lpad
I mean everything lpad function even overpriced databases, docs.oracle.com/cd/B28359_01/olap.111/b28126/…
so it's not like typing lapd + <langauge> is difficult.
 

« first day (2267 days earlier)      last day (2602 days later) »