Computers

SQL Tuning

Generating Optimal Execution Plans

Author: Dan Tow

Publisher: "O'Reilly Media, Inc."

ISBN: 9780596552367

Category: Computers

Page: 338

View: 7041

A poorly performing database application not only costs users time, but also has an impact on other applications running on the same computer or the same network. SQL Tuning provides an essential next step for SQL developers and database administrators who want to extend their SQL tuning expertise and get the most from their database applications.There are two basic issues to focus on when tuning SQL: how to find and interpret the execution plan of an SQL statement and how to change SQL to get a specific alternate execution plan. SQL Tuning provides answers to these questions and addresses a third issue that's even more important: how to find the optimal execution plan for the query to use.Author Dan Tow outlines a timesaving method he's developed for finding the optimum execution plan--rapidly and systematically--regardless of the complexity of the SQL or the database platform being used. You'll learn how to understand and control SQL execution plans and how to diagram SQL queries to deduce the best execution plan for a query. Key chapters in the book include exercises to reinforce the concepts you've learned. SQL Tuning concludes by addressing special concerns and unique solutions to "unsolvable problems."Whether you are a programmer who develops SQL-based applications or a database administrator or other who troubleshoots poorly tuned applications, SQL Tuning will arm you with a reliable and deterministic method for tuning your SQL queries to gain optimal performance.
Computers

SQL Performance Tuning

Author: Peter Gulutzan,Trudy Pelzer

Publisher: Addison-Wesley Professional

ISBN: 9780201791693

Category: Computers

Page: 495

View: 2647

A very practical guide to making databases run faster and better. A poorly performing database application can cost each user time, and have an impact on other applications running on the same computer or the same network. This book will help DBAUs and programmers improve the performance of their databases.
Computers

SQL Server Execution Plans

Author: Grant Fritchey

Publisher: Red Gate Books

ISBN: 9781906434939

Category: Computers

Page: 344

View: 9376

Every day, out in the various online forums devoted to SQL Server, and on Twitter, the same types of questions come up repeatedly: Why is this query running slowly? Why is SQL Server ignoring my index? Why does this query run quickly sometimes and slowly at others? My response is the same in each case: have you looked at the execution plan? An execution plan describes what's going on behind the scenes when SQL Server executes a query. It shows how the query optimizer joined the data from the various tables defined in the query, which indexes it used, if any, how it performed any aggregations or sorting, and much more. It also estimates the cost of all of these operations, in terms of the relative load placed on the system. Every Database Administrator, developer, report writer, and anyone else who writes T-SQL to access SQL Server data, must understand how to read and interpret execution plans.My book leads you right from the basics of capturing plans, through how to interrupt them in their various forms, graphical or XML, and then how to use the information you find there to diagnose the most common causes of poor query performance, and so optimize your SQL queries, and improve your indexing strategy.
Computers

Oracle SQL Tuning with Oracle SQLTXPLAIN

Oracle Database 12c Edition

Author: Stelios Charalambides

Publisher: Apress

ISBN: 1484224361

Category: Computers

Page: 408

View: 6943

Learn through this practical guide to SQL tuning how Oracle's own experts do it, using a freely downloadable tool called SQLTXPLAIN. This new edition has been expanded to include AWR, Oracle 12c Statistics, interpretation of SQL Monitor reports, Parallel execution, and Exadata-related features. Reading this book and using SQL helps you learn to tune even the most complex SQL, and you'll learn to do it quickly, without the huge learning curve usually associated with tuning as a whole. Firmly based in real-world problems, this book helps you reclaim system resources and avoid the most common bottleneck in overall performance, badly tuned SQL. You'll learn how the optimizer works, how to take advantage of its latest features, and when it's better to turn them off. Best of all, the book is updated to cover the very latest feature set in Oracle Database 12c. Covers AWR report integration Helps with SQL Monitor Report Interpretation Provides a reliable method that is repeatable Shows the very latest tuning features in Oracle Database 12c Enables the building of test cases without affecting production What You'll Learn Identify how and why complex SQL has gone wrong Correctly interpret AWR reports generated via SQLTXPLAIN Collect the best statistics for your environment Know when to invoke built-in tuning facilities Recognize when tuning is not the solution Spot the steps in a SQL statement's execution plan that are critical to performance of that statement Modify your SQL to solve performance problems and increase the speed and throughput of production database systems Who This Book Is For divAnyone who deals with SQL and SQL tuning. Both developers and DBAs will benefit from learning how to use the SQLTXPLAIN tool, and from the problem solving methodology in this book.
Computers

Refactoring SQL Applications

Author: Stephane Faroult,Pascal L'Hermite

Publisher: "O'Reilly Media, Inc."

ISBN: 9780596551773

Category: Computers

Page: 298

View: 839

What can you do when database performance doesn't meet expectations? Before you turn to expensive hardware upgrades to solve the problem, reach for this book. Refactoring SQL Applications provides a set of tested options for making code modifications to dramatically improve the way your database applications function. Backed by real-world examples, you'll find quick fixes for simple problems, in-depth answers for more complex situations, and complete solutions for applications with extensive problems. Learn to: Determine if and where you can expect performance gains Apply quick fixes, such as limiting calls to the database in stored functions and procedures Refactor tasks, such as replacing application code by a stored procedure, or replacing iterative, procedural statements with sweeping SQL statements Refactor flow by increasing parallelism and switching business-inducted processing from synchronous to asynchronous Refactor design using schema extensions, regular views, materialized views, partitioning, and more Compare before and after versions of a program to ensure you get the same results once you make modifications Refactoring SQL Applications teaches you to recognize and assess code that needs refactoring, and to understand the crucial link between refactoring and performance. If and when your application bogs down, this book will help you get it back up to speed.
Computers

SQL Server Query Performance Tuning

Author: Sajal Dam,Grant Fritchey

Publisher: Apress

ISBN: 1430267429

Category: Computers

Page: 612

View: 5961

Queries not running fast enough? Wondering about the in-memory database features in 2014? Tired of phone calls from frustrated users? Grant Fritchey’s book SQL Server Query Performance Tuning is the answer to your SQL Server query performance problems. The book is revised to cover the very latest in performance optimization features and techniques, especially including the newly-added, in-memory database features formerly known under the code name Project Hekaton. This book provides the tools you need to approach your queries with performance in mind. SQL Server Query Performance Tuning leads you through understanding the causes of poor performance, how to identify them, and how to fix them. You’ll learn to be proactive in establishing performance baselines using tools like Performance Monitor and Extended Events. You’ll learn to recognize bottlenecks and defuse them before the phone rings. You’ll learn some quick solutions too, but emphasis is on designing for performance and getting it right, and upon heading off trouble before it occurs. Delight your users. Silence that ringing phone. Put the principles and lessons from SQL Server Query Performance Tuning into practice today. Covers the in-memory features from Project Hekaton Helps establish performance baselines and monitor against them Guides in troubleshooting and eliminating of bottlenecks that frustrate users
Computers

Oracle SQL Performance Tuning and Optimization

It's All about the Cardinalities

Author: Kevin Meade

Publisher: CreateSpace

ISBN: 9781501022692

Category: Computers

Page: 568

View: 7666

Written by a Senior Database Administrator who has worked with the Oracle RDBMS for thirty years, this is a book which teaches the skill of SQL Tuning for the Oracle Database. Not a list of one-off tricks or tips, nor a glossing over of topics; this book offers an in-depth process covering discovery, analysis, and problem resolution. Learn the science behind SQL Tuning. Learn and apply the FILTERED ROWS PERCENTAGE Cardinality based method of tuning Determine a query's Driving Table and Join Order Construct Query Diagrams, Data Models, and Join Trees Build and use Count / Filter / and Reconstruction Queries Identify Waste in a Query Execution Plan Zero in on Cardinality Divergence using Estimated vs. Actuals Use the ACCESS / FILTER / COVERAGE strategy to build indexes for Problem Queries Exploit THE 2% RULE in analyzing Access method and Join method Classify queries as Precision Style or Warehouse Style Understand Hash Join mechanics and make Hash Joins go faster Make HINTS work as Detection Tools rather than clubs Avoid early Database Design flaws Manage Statistics and deal with common Statistics problems (NDV, Uniform Distribution, Independence, Dynamic Sampling) (Staleness, Skew, Dependence, Defaulting, Out-Of-Bounds, Transiency, Bloat) Perfect your Question Based Analyis Technique and more Included are: a special chapter for EXADATA, a LAB which demonstrates the cardinality based process of SQL Tuning, and twenty three magical SQL scripts that make the process of SQL Tuning easy to do. Learn the skill of SQL Tuning as taught by an expert who does it for a living, and become the go-to specialist in your company. Chapter 1: DRIVING TABLE and JOIN ORDER Chapter 2: Ways to Use a Query Execution Plan Chapter 3: The Best Indexes for a Query Chapter 4: JOINS Chapter 5: HINTS Chapter 6: BASICS Chapter 7: ROW COUNTS and RUN TIMES Chapter 8: EXADATA LAB: Reverse Engineering the QEP Appendix: Know Your Scripts Scripts for analyzing queries and plans Scripts for examining an active database Scripts for looking at metadata showplan showplanshort showplanconstraints showplancountqueries showplandatamodel showplandrivingtable showplanfilterqueries showplanfrpspreadsheetcode showplanindexes showplannumrows showplanquerydiagram showplantables showplantablesunique loadplanfromcache loadplanfromhist showtopcpu showowner showindexes showconstraints showcolstats showhistograms showallscanrates showallworkareas It's all about the Cardinalities
Computers

Microsoft SQL Server 2014 Query Tuning & Optimization

Author: Benjamin Nevarez

Publisher: McGraw Hill Professional

ISBN: 0071829431

Category: Computers

Page: 416

View: 769

Optimize Microsoft SQL Server 2014 queries and applications Microsoft SQL Server 2014 Query Tuning & Optimization is filled with ready-to-use techniques for creating high-performance queries and applications. The book describes the inner workings of the query processor so you can write better queries and provide the query processor with the quality information it needs to produce efficient execution plans. You’ll also get tips for troubleshooting underperforming queries. In-Memory OLTP (Hekaton), a key new feature of SQL Server 2014, is fully covered in this practical guide. Understand how the query optimizer works Troubleshoot queries using extended events, SQL trace, dynamic management views (DMVs), the data collector, and other tools Work with query operators for data access, joins, aggregations, parallelism, and updates Speed up queries and dramatically improve application performance by creating the right indexes Understand statistics and how to detect and fix cardinality estimation errors Maximize OLTP query performance using In-Memory OLTP (Hekaton) features, including memory-optimized tables and natively compiled stored procedures Monitor and promote plan caching and reuse to improve application performance Improve the performance of data warehouse queries using columnstore indexes Handle query processor limitations with hints and other methods
Computers

The Art of SQL

Author: Stephane Faroult,Peter Robson

Publisher: "O'Reilly Media, Inc."

ISBN: 0596514484

Category: Computers

Page: 372

View: 2991

For all the buzz about trendy IT techniques, data processing is still at the core of our systems, especially now that enterprises all over the world are confronted with exploding volumes of data. Database performance has become a major headache, and most IT departments believe that developers should provide simple SQL code to solve immediate problems and let DBAs tune any "bad SQL" later. In The Art of SQL, author and SQL expert Stephane Faroult argues that this "safe approach" only leads to disaster. His insightful book, named after Art of War by Sun Tzu, contends that writing quick inefficient code is sweeping the dirt under the rug. SQL code may run for 5 to 10 years, surviving several major releases of the database management system and on several generations of hardware. The code must be fast and sound from the start, and that requires a firm understanding of SQL and relational theory. The Art of SQL offers best practices that teach experienced SQL users to focus on strategy rather than specifics. Faroult's approach takes a page from Sun Tzu's classic treatise by viewing database design as a military campaign. You need knowledge, skills, and talent. Talent can't be taught, but every strategist from Sun Tzu to modern-day generals believed that it can be nurtured through the experience of others. They passed on their experience acquired in the field through basic principles that served as guiding stars amid the sound and fury of battle. This is what Faroult does with SQL. Like a successful battle plan, good architectural choices are based on contingencies. What if the volume of this or that table increases unexpectedly? What if, following a merger, the number of users doubles? What if you want to keep several years of data online? Faroult's way of looking at SQL performance may be unconventional and unique, but he's deadly serious about writing good SQL and using SQL well. The Art of SQL is not a cookbook, listing problems and giving recipes. The aim is to get you-and your manager-to raise good questions.
Computers

The Art of High Performance SQL Code

SQL Server Execution Plans

Author: Grant Fritchey

Publisher: N.A

ISBN: 9781906434021

Category: Computers

Page: 242

View: 7914

Execution plans show you what's going on behind the scenes in SQL Server. They can provide you with a wealth of information on how your queries are being executed by SQL Server, including: Which indexes are being used, and where no indexes are being used at all. How the data is being retrieved, and joined, from the tables defi ned in your query. How aggregations in GROUP BY queries are put together. The anticipated load and the estimated cost that all these operations place upon the system. Grant Fritchey's book is the only in-depth look at how to improve your SQL query performance through careful design of execution plans. Sample chapters of the ebook have garnered stunning reviews, such as: "All I can say is WOW. This has to be the best reference I have ever seen on Execution Plans in SQL Server. My hats off to Grant Fritchey" Jonathan Kehayias.
Database management

SQL Performance Explained

Everything Developers Need to Know about SQL Performance

Author: Markus Winand

Publisher: N.A

ISBN: 9783950307825

Category: Database management

Page: 196

View: 7563

Computers

Oracle Database 11g Performance Tuning Recipes

A Problem-Solution Approach

Author: Sam Alapati,Darl Kuhn,Bill Padfield

Publisher: Apress

ISBN: 1430236620

Category: Computers

Page: 592

View: 1727

Performance problems are rarely "problems" per se. They are more often "crises" during which you’re pressured for results by a manager standing outside your cubicle while your phone rings with queries from the help desk. You won’t have the time for a leisurely perusal of the manuals, nor to lean back and read a book on theory. What you need in that situation is a book of solutions, and solutions are precisely what Oracle Database 11g Performance Tuning Recipes delivers. Oracle Database 11g Performance Tuning Recipes is a ready reference for database administrators in need of immediate help with performance issues relating to Oracle Database. The book takes an example-based approach, wherein each chapter covers a specific problem domain. Within each chapter are "recipes," showing by example how to perform common tasks in that chapter’s domain. Solutions in the recipes are backed by clear explanations of background and theory from the author team. Whatever the task, if it’s performance-related, you’ll probably find a recipe and a solution in this book. Provides proven solutions to real-life Oracle performance problems Offers relevant background and theory to support each solution Written by a team of experienced database administrators successful in their careers What you’ll learn Optimize the use of memory and storage Monitor performance and troubleshoot problems Identify and improve poorly-performing SQL statements Adjust the most important optimizer parameters to your advantage Create indexes that get used and make a positive impact upon performance Automate and stabilize using key features such as SQL Tuning Advisor and SQL Plan Baselines Who this book is for Oracle Database 11g Performance Tuning Recipes is aimed squarely at Oracle Database administrators. The book especially appeals to those administrators desiring to have at their side a ready-to-go set of solutions to common database performance problems. Table of Contents Optimizing Table Performance Choosing and Optimizing Indexes Optimizing Instance Memory Monitoring System Performance Minimizing System Contention Analyzing Operating System Performance Troubleshooting the Database Creating Efficient SQL Manually Tuning SQL Tracing SQL Execution Automated SQL Tuning Execution Plan Optimization and Cosistency Configuring the Optimizer Implementing Query Hints Executing SQL in Parallel
Computers

Oracle SQL Tuning Pocket Reference

Write Efficient SQL

Author: Mark Gurry

Publisher: "O'Reilly Media, Inc."

ISBN: 9780596552138

Category: Computers

Page: 110

View: 8540

One of the most important challenges faced by Oracle database administrators and Oracle developers is the need to tune SQL statements so that they execute efficiently. Poorly tuned SQL statements are one of the leading causes of substandard database performance and poor response time. SQL statements that perform poorly result in frustration for users, and can even prevent a company from serving its customers in a timely manner. In this book, Mark Gurry shares his in-depth knowledge of Oracle's SQL statement optimizers. Mark's knowledge is the result of many hard-fought tuning battles during his many years of providing Oracle tuning services to clients. Mark provides insights into the workings of the rule-based optimizer that go well beyond what the rules tell you. Mark also provides solutions to many common problems that occur with both the rule-based and cost-based optimizers. In addition to the specific problem/solution scenarios for the optimizers, Mark provides a number of handy SQL tuning tips. He discusses the various optimizer hints, telling you when they can be used to good effect. Finally, Mark discusses the use of the DBMS_STATS package to manage database statistics, and the use of outlines to specify execution plans for SQL statements in third-party applications that you can't otherwise modify.
Computers

High Performance MySQL

Optimization, Backups, and Replication

Author: Baron Schwartz,Peter Zaitsev,Vadim Tkachenko

Publisher: "O'Reilly Media, Inc."

ISBN: 1449332501

Category: Computers

Page: 826

View: 4303

How can you bring out MySQL’s full power? With High Performance MySQL, you’ll learn advanced techniques for everything from designing schemas, indexes, and queries to tuning your MySQL server, operating system, and hardware to their fullest potential. This guide also teaches you safe and practical ways to scale applications through replication, load balancing, high availability, and failover. Updated to reflect recent advances in MySQL and InnoDB performance, features, and tools, this third edition not only offers specific examples of how MySQL works, it also teaches you why this system works as it does, with illustrative stories and case studies that demonstrate MySQL’s principles in action. With this book, you’ll learn how to think in MySQL. Learn the effects of new features in MySQL 5.5, including stored procedures, partitioned databases, triggers, and views Implement improvements in replication, high availability, and clustering Achieve high performance when running MySQL in the cloud Optimize advanced querying features, such as full-text searches Take advantage of modern multi-core CPUs and solid-state disks Explore backup and recovery strategies—including new tools for hot online backups
Computers

Mastering Oracle SQL

Putting Oracle SQL to Work

Author: Sanjay Mishra,Alan Beaulieu

Publisher: "O'Reilly Media, Inc."

ISBN: 9780596552473

Category: Computers

Page: 496

View: 558

The vast majority of Oracle SQL books discuss some syntax, provide the barest rudiments of using Oracle SQL, and perhaps include a few simple examples. It might be enough to pass a survey course, or give you some buzz words to drop in conversation with real Oracle DBAs. But if you use Oracle SQL on a regular basis, you want much more. You want to access the full power of SQL to write queries in an Oracle environment. You want a solid understanding of what's possible with Oracle SQL, creative techniques for writing effective and accurate queries, and the practical, hands-on information that leads to true mastery of the language. Simply put, you want useful, expert best practices that can be put to work immediately, not just non-vendor specific overview or theory.Updated to cover the latest version of Oracle, Oracle 10g, this edition of the highly regarded Mastering Oracle SQL has a stronger focus on technique and on Oracle's implementation of SQL than any other book on the market. It covers Oracle s vast library of built-in functions, the full range of Oracle SQL query-writing features, regular expression support, new aggregate and analytic functions, subqueries in the SELECT and WITH clauses, multiset union operators, enhanced support for hierarchical queries: leaf and loop detection, and the CONNECT_BY_ROOT operator, new partitioning methods (some introduced in Oracle9i Release 2), and the native XML datatype, XMLType.Mastering Oracle SQL, 2nd Edition fills the gap between the sometimes spotty vendor documentation, and other books on SQL that just don't explore the full depth of what is possible with Oracle-specific SQL. For those who want to harness the untapped (and often overlooked) power of Oracle SQL, this essential guide for putting Oracle SQL to work will prove invaluable.
Computers

Oracle Database 12c Release 2 Performance Tuning Tips & Techniques

Author: Richard Niemiec

Publisher: McGraw Hill Professional

ISBN: 1259589692

Category: Computers

Page: 848

View: 8586

Proven Database Optimization Solutions―Fully Updated for Oracle Database 12c Release 2 Systematically identify and eliminate database performance problems with help from Oracle Certified Master Richard Niemiec. Filled with real-world case studies and best practices, Oracle Database 12c Release 2 Performance Tuning Tips and Techniques details the latest monitoring, troubleshooting, and optimization methods. Find out how to identify and fix bottlenecks on premises and in the cloud, configure storage devices, execute effective queries, and develop bug-free SQL and PL/SQL code. Testing, reporting, and security enhancements are also covered in this Oracle Press guide. • Properly index and partition Oracle Database 12c Release 2 • Work effectively with Oracle Cloud, Oracle Exadata, and Oracle Enterprise Manager • Efficiently manage disk drives, ASM, RAID arrays, and memory • Tune queries with Oracle SQL hints and the Trace utility • Troubleshoot databases using V$ views and X$ tables • Create your first cloud database service and prepare for hybrid cloud • Generate reports using Oracle’s Statspack and Automatic Workload Repository tools • Use sar, vmstat, and iostat to monitor operating system statistics
Computers

SQL Cookbook

Author: Anthony Molinaro

Publisher: "O'Reilly Media, Inc."

ISBN: 0596009763

Category: Computers

Page: 595

View: 2794

A guide to SQL covers such topics as retrieving records, metadata queries, working with strings, data arithmetic, date manipulation, reporting and warehousing, and hierarchical queries.
Computers

Designing Data-Intensive Applications

The Big Ideas Behind Reliable, Scalable, and Maintainable Systems

Author: Martin Kleppmann

Publisher: "O'Reilly Media, Inc."

ISBN: 1491903104

Category: Computers

Page: 624

View: 3807

Data is at the center of many challenges in system design today. Difficult issues need to be figured out, such as scalability, consistency, reliability, efficiency, and maintainability. In addition, we have an overwhelming variety of tools, including relational databases, NoSQL datastores, stream or batch processors, and message brokers. What are the right choices for your application? How do you make sense of all these buzzwords? In this practical and comprehensive guide, author Martin Kleppmann helps you navigate this diverse landscape by examining the pros and cons of various technologies for processing and storing data. Software keeps changing, but the fundamental principles remain the same. With this book, software engineers and architects will learn how to apply those ideas in practice, and how to make full use of data in modern applications. Peer under the hood of the systems you already use, and learn how to use and operate them more effectively Make informed decisions by identifying the strengths and weaknesses of different tools Navigate the trade-offs around consistency, scalability, fault tolerance, and complexity Understand the distributed systems research upon which modern databases are built Peek behind the scenes of major online services, and learn from their architectures
Computers

Oracle SQL Tuning & CBO Internals

Author: Kimberly Floss

Publisher: Rampant TechPress

ISBN: 9780974599335

Category: Computers

Page: 340

View: 6473

As Oracle professionals are challenged to create SQL statements that will support thousands of concurrent executions with sub-second response time, this book’s timing is critical as tuning Oracle SQL has become the single most important skill of the Oracle professional. While not appropriate for the beginner, this book allows senior Oracle professionals to explore important internal mechanisms within Oracle and the powerful and complex internals of Oracle SQL execution. Topics include the internals of Oracle cost-based SQL optimizer, SQL execution internals within the library cache, Oracle SQL coding and optimization techniques, and Oracle index internals. Also included is a ready-to-use code depot full of working SQL tuning scripts, which allow for quick optimization of the SQL and indexes inside the Oracle database.