SQL & PL/SQL
Submitted by John Watson on Fri, 2017-03-31 05:01
I am fascinated by what I call "equal SQL": statements that are equivalent, in that they deliver the same result but may have hugely different performance characteristics. Here's a little case study.
Submitted by ymusani on Fri, 2017-01-20 03:00
Row Limiting Clause for Top-N Queries in Oracle Database 12c Release 1 (12.1)
Submitted by John Watson on Fri, 2016-10-14 07:54
Developers who come to Oracle with a background in procedural languages sometimes do not understand how efficient SQL's set oriented processing can be. This little demonstration should convince them: never use PL/SQL when SQL will do.
Submitted by John Watson on Sun, 2016-10-02 02:57
We all know that using SELECT * is bad programming. One reason is that you cannot control the order in which columns are returned. Well, you can in release 12c.
Submitted by John Watson on Fri, 2016-08-12 03:44
Many developers find that their code fails with ORA-942, but when they test the failing statement from the SQL> prompt, it works. Why, and what can you do to fix it?
Submitted by Natalka Roshak on Mon, 2016-06-13 14:25
The CONNECT BY syntax provides a useful pseudocolumn, CONNECT_BY_ISLEAF, which identifies leaf nodes in the data: it’s 1 when a row has no further children, 0 otherwise. In this post, I’ll look at emulating this pseudocolumn using recursive WITH.
Submitted by Natalka Roshak on Fri, 2016-06-03 04:38
In my last post, I looked at using recursive WITH to implement simple recursive algorithms in SQL. One very common use of recursion is to traverse hierarchical data. I recently wrote a series of posts on hierarchical data, using Oracle’s CONNECT BY syntax and a fun example. In this post, I’ll be revisiting the same data using recursive WITH.
Submitted by Natalka Roshak on Tue, 2016-05-24 04:03
I recently had the opportunity to talk with Tom Kyte (!), and in the course of our conversation, he really made me face up to the fact that the SQL syntax I use every day is frozen in time: I’m not making much use of the analytic functions and other syntax that Oracle has introduced since 8i.
Submitted by MarcMartens on Tue, 2015-02-24 06:41
Why publishing this under SQL instead of RDBMS Server?
The necessaty to create supporting indexes for foreign keys has been explained in other articles.
However writing a foolproof query to identify missing FK indexes is not so straightforward as it might look. I used to do it PLSQL, but this has proven not to scale very well and taking quite some elapsed time and system resources in databases with many thousands of tables. The blog entry is about the challenge to get the job done with a well performing SQL statement.
Submitted by John Watson on Sat, 2015-02-21 08:12
Another example of what I think of as "the self-tuning database". Setting optimizer_dynamic_sampling=11 can fix many performance problems, without the DBA needing to use his brain at all.