Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between union and union all

Answer Posted / vishal

UNION removes duplicates, whereas UNION ALL does not.

In order to remove duplicates the result set must be
sorted, and this may have an impact on the performance of
the UNION, depending on the volume of data being sorted,
and the settings of various RDBMS parameters ( For Oracle
PGA_AGGREGATE_TARGET with WORKAREA_SIZE_POLICY=AUTO or
SORT_AREA_SIZE and SOR_AREA_RETAINED_SIZE if
WORKAREA_SIZE_POLICY=MANUAL ).

Basically, the sort is faster if it can be carried out in
memory, but the same caveat about the volume of data
applies.

Of course, if you need data returned without duplicates
then you must use UNION, depending on the source of your
data.

I would have commented on the first post to qualify the "is
much less performant" comment, but have insufficient
reputation (points) to do so.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sql better than access?

984


What is the basic form of sql query?

906


What does stand for in sql?

939


Is sql better than excel?

1085


How can you load microsoft excel data into oracle? : aql loader

1143


what happens if null values are involved in expressions? : Sql dba

1020


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

1097


what is the command used to fetch first 5 characters of the string? : Sql dba

1610


What is procedure and function in sql?

952


What is data abstraction in sql?

981


Write an sql query to select all records from the table?

988


What is the starting oracle error number?

1022


What is synchronized subquery?

1117


What is sql and how does it work?

1116


Is sql procedural language?

941