Re: I need to vent

  • From: Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 3 Mar 2016 15:52:23 -0500

On 03/01/2016 10:56 AM, Matt Adams wrote:


1.8 million characters!!!!! How in bloody hell does ANYTHING write a single sql statement that 1.8 million characters long.



Actually, it's quite simple:
select sysdate
<few millions of empty lines and space characters>
from dual;

Voila! One reason to write a thing like that would be to prank your favourite DBA. You can do it in a little bit more expensive way by doing something like this:

select count(*)
<few millions of empty lines with space characters>
from emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp,emp;

This is going to peg a CPU thread for a good 5 minutes, using 100% of CPU power. The "working part" is the FROM clause, which generates a Cartesian product and it is at the end of the mostly blank SQL, so it would be almost impossible to see using SQL*Developer or Toad. The downside of the SQL is that as soon as the DBA sees SCOTT.EMP used in production, she or he will probably kill the session immediately. The good side of this SQL is that it will send your BCHR through the roof.


--
Mladen Gogala
Oracle DBA
Tel: (347) 321-1217

Other related posts: