Attach query or subquery

Are there rules for developers when you need to use a union instead of a subquery, or are they the same.

+5
source share
8 answers

Depends on the DBMS. You should compare execution plans for both queries.

In my experience with Oracle 10 and 11, execution plans are always the same.

+2
source

The first principle: "Specify the request correctly." The second principle is that "simply and explicitly indicate the request" (that is where you usually make the choice). The third is "request a request so that it works efficiently."

dbms , , (, , ).

MySQL , . Oracle, SQL Server, Informix dbms, , . MySQL, -, , .

+5

, .

+3

, - , .

, JOIN- ON WHERE ( , ).

+3
.
+2

, . - - ,

, . , - , .

, Alex

+2

( , , " - " ).

, .

+2

SQL Server , , , . , . , . - -.

+1

All Articles