SQL & PL/SQL

SQL and PL/SQL Articles

Is row-by-row processing really slow-by-slow? Emphatically: YES

articles: 

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.

How to change column order when using SELECT *

articles: 

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.

Roles , PL/SQL, and ORA-00942: table or view does not exist

articles: 

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?

Natalka Roshak's picture

Recursive WITH, part III: IS_LEAF

articles: 

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.

Natalka Roshak's picture

Recursive WITH, part II: Hierarchical queries

articles: 

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.

Natalka Roshak's picture

Recursion with recursive WITH

articles: 

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.

Identifying missing FK indexes

articles: 

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.

Tuning SQL with dynamic sampling

articles: 

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.

Book review: Kevin Meade, Oracle SQL Performance Tuning and Optimization

articles: 

Excellent exposition of a very effective SQL tuning metodology

Oracle External Tables

articles: 

 The Oracle external tables feature allows us to access data in external sources as if it is a table in the database.
 External tables are read-only.
 No data manipulation language (DML) operations is allowed on an external table.
 An external table does not describe any data that is stored in the database.

Pages

Subscribe to RSS - SQL & PL/SQL