Tutorial66.com
@Share Application Development Skill.



Tutorial is tutorial...66 is My Country Code Up to 10 Years EXP for Application Development Role in Thailand.
collapse

Tutorial Category



Topic: SQL UNION ALL use UNION ALL instead of UNION for Better Performance  (Read 153 times)


My Development skill
Java JSP Servlet EJB
Spring Framework
Hibernate Framework
iReport Jasper Report
Apache CXF
PHP Codigniter
Oracle PLSQL
Unix Shell Script
SQL UNION ALL use UNION ALL instead of UNION in WHERE clause for Better Performance

Use this query for better query performance:
Use UNION ALL if you don't worry for duplicate data.
Code: [Select]
select  field_1,field_2 from my_table1
UNION ALL
select  field_1,field_2 from my_table2


Instead of this query:
Code: [Select]
select  field_1,field_2 from my_table1
UNION
select  field_1,field_2 from my_table2




SimplePortal 2.3.3 © 2008-2010, SimplePortal