Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Wiki
Search Coderanch
Advance search
Google search
Register / Login
Bookmark Topic
Watch Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forums:
JDBC and Relational Databases
Wiki
Sql Best Practices
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Following best practices in SQL can save you a lot of time and nerves. Here is the list of the most important points to follow:
Always use ORDER BY in your SQL statement if the order of returned rows is important
Avoid implicit conversions of columns and parameters in SQL statements
Always include a column list in select and insert statements
Do not forget about SQL NULL
Avoid heavy processing in Java memory
Use UNION ALL instead of UNION when you can
Avoid JDBC pagination for large results
Avoid joining data in Java memory
Avoid removing duplicates with DISTINCT or UNION, when you have an accidental cartesian product
Use the MERGE statement when possible
Use window functions instead of aggregate functions, when possible
Avoid Java in-memory sorting for sort indirections
Avoid inserting lots of records one by one
JdbcFaq
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Sql Cartesian Product
Losing Leading Zero on Insert
Database connectivity-Context.xml
PreparedStatement not working properly
Problem regarding query
More...