/Free Control Statements, Part 2

DO Stuff: There’s an old programmers’ adage: “Where there’s an IF, there’s a DO,” and darned if it isn’t true. By David Shirey Editor’s Note: This article is excerpted from chapter 5 of 21st Century RPG: /Free, ILE, and MVC, by David Shirey. Fortunately, most of what we said for IFs is true for DO loops. The DO itself has been eliminated from /Free (use FOR). And the DOWGT, DOULT, and others of that ilk are out as well. What you are left with is simpler and more straightforward: DOW and DOU with a conditional statement. The basic syntax is:

SQL Anti-Pattern: Indexing Every Column Individually

Indexes are magic, right? Add one and magically the performance of a query improves.

Well, not really. Each index has a cost, and thoughtful multi-column indexes will go a lot further than individual indexes. Let’s dig into the details.

What an Optimizer Does

Relational databases require queries to specify what data they want returned with no specification of where that data is on disk.… Read the rest

Verified by MonsterInsights