This document discusses how to optimize performance in SQL Server. It covers:
1) Why performance tuning is necessary to allow systems to scale, improve performance, and save costs.
2) How to optimize SQL Server performance by addressing CPU, memory, I/O, and other factors like compression and partitioning.
3) How to optimize the database for performance through techniques like schema design, indexing, locking, and query optimization.
Analyzing big data quickly and efficiently requires a data warehouse optimized to handle and scale for large datasets. Amazon Redshift is a fast, petabyte-scale data warehouse that makes it simple and cost-effective to analyze big data for a fraction of the cost of traditional data warehouses. In this session, we take an in-depth look at data warehousing with Amazon Redshift for big data analytics. We cover best practices to take advantage of Amazon Redshift's columnar technology and parallel processing capabilities to deliver high throughput and query performance. We also discuss how to design optimal schemas, load data efficiently, and use work load management.
Session aims at introducing less familiar audience to the Oracle database statistics concept, why statistics are necessary and how the Oracle Cost-Based Optimizer uses them
The document discusses SQL Server monitoring and troubleshooting. It provides an overview of SQL Server monitoring, including why it is important and common monitoring tools. It also describes the SQL Server threading model, including threads, schedulers, states, the waiter list, and runnable queue. Methods for using wait statistics like the DMVs sys.dm_os_waiting_tasks and sys.dm_os_wait_stats are presented. Extended Events are introduced as an alternative to SQL Trace. The importance of establishing a performance baseline is also noted.
From noted SQL Server expert and author Kevin Kline - Let’s face it. You can effectively do many IT jobs related to Microsoft SQL Server without knowing the internals of how SQL Server works. Many great developers, DBAs, and designers get their day-to-day work completed on time and with reasonable quality while never really knowing what’s happening behind the scenes. But if you want to take your skills to the next level, it’s critical to know SQL Server’s internal processes and architecture. This session will answer questions like:
- What are the various areas of memory inside of SQL Server?
- How are queries handled behind the scenes?
- What does SQL Server do with procedural code, like functions, procedures, and triggers?
- What happens during checkpoints? Lazywrites?
- How are IOs handled with regards to transaction logs and database?
- What happens when transaction logs and databases grow or shrinks?
This fast paced session will take you through many aspects of the internal operations of SQL Server and, for those topics we don’t cover, will point you to resources where you can get more information.
Database tuning is the process of optimizing a database to maximize performance. It involves activities like configuring disks, tuning SQL statements, and sizing memory properly. Database performance issues commonly stem from slow physical I/O, excessive CPU usage, or latch contention. Tuning opportunities exist at the level of database design, application code, memory settings, disk I/O, and eliminating contention. Performance monitoring tools like the Automatic Workload Repository and wait events help identify problem areas.
Advanced SQL covers selecting columns, aggregate functions like MIN() and MAX(), the CASE WHEN statement, JOINs, the WHERE clause, GROUP BY, declaring variables, and subqueries
Meta/Facebook's database serving social workloads is running on top of MyRocks (MySQL on RocksDB). This means our performance and reliability depends a lot on RocksDB. Not just MyRocks, but also we have other important systems running on top of RocksDB. We have learned many lessons from operating and debugging RocksDB at scale.
In this session, we will offer an overview of RocksDB, key differences from InnoDB, and share a few interesting lessons learned from production.
The document discusses various disaster recovery strategies for SQL Server including failover clustering, database mirroring, and peer-to-peer transactional replication. It provides advantages and disadvantages of each approach. It also outlines the steps to configure replication for Always On Availability Groups which involves setting up publications and subscriptions, configuring the availability group, and redirecting the original publisher to the listener name.
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
The document provides an overview of Oracle database performance tuning best practices for DBAs and developers. It discusses the connection between SQL tuning and instance tuning, and how tuning both the database and SQL statements is important. It also covers the connection between the database and operating system, how features like data integrity and zero downtime updates are important. The presentation agenda includes topics like identifying bottlenecks, benchmarking, optimization techniques, the cost-based optimizer, indexes, and more.
This document discusses AlwaysOn availability technologies in SQL Server 2017, including Failover Cluster Instances (FCI) and Availability Groups (AG). It provides an overview of how FCI and AG work to provide high availability and disaster recovery, including capabilities like multi-subnet support. The document also summarizes new features and enhancements to FCI and AG in SQL Server 2014, 2016 and 2017.
- Oracle Database is a comprehensive, integrated database management system that provides an open approach to information management.
- The Oracle architecture includes database structures like data files, control files, and redo log files as well as memory structures like the system global area (SGA) and process global area (PGA).
- Key components of the Oracle architecture include the database buffer cache, shared pool, redo log buffer, and background processes that manage instances.
The document provides guidance on understanding and optimizing database performance. It emphasizes the importance of properly designing schemas, normalizing data, using appropriate data types, and creating useful indexes. Explain plans should be used to test queries and identify optimization opportunities like adding missing indexes. Overall, the document encourages developers to view the database as a collaborative "friend" rather than an enemy, by understanding its capabilities and limitations.
MS SQL Server is a database server produced by Microsoft that enables users to write and execute SQL queries and statements. It consists of several features like Query Analyzer, Profiler, and Service Manager. Multiple instances of SQL Server can be installed on a machine, with each instance having its own set of users, databases, and other objects. SQL Server uses data files, filegroups, and transaction logs to store database objects and record transactions. The data dictionary contains metadata about database schemas and is stored differently in Oracle and SQL Server.
The document discusses how the PostgreSQL query planner works. It explains that a query goes through several stages including parsing, rewriting, planning/optimizing, and execution. The optimizer or planner has to estimate things like the number of rows and cost to determine the most efficient query plan. Statistics collected by ANALYZE are used for these estimates but can sometimes be inaccurate, especially for n_distinct values. Increasing the default_statistics_target or overriding statistics on columns can help address underestimation issues. The document also discusses different plan types like joins, scans, and aggregates that the planner may choose between.
This document provides guidance on tuning MySQL for optimal performance. It discusses adjusting various configuration settings related to I/O, memory allocation, query caching, and InnoDB settings. Tuning aspects like I/O, queries, maintenance and configurations are recommended to maximize speed within the constraints of other services. Transaction logs and temporary file storage especially impact performance as heavy consumers of I/O.
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
The document discusses various techniques for identifying and analyzing SQL performance issues in an Oracle database, including gathering diagnostic data from AWR reports, ASH reports, SQL execution plans, and real-time SQL monitoring reports. It provides an overview of how to use these tools to understand what is causing performance problems by identifying what is slow, quantifying the impact, determining the component involved, and analyzing the root cause.
Why oracle data guard new features in oracle 18c, 19c
Oracle Data Guard ensures high availability, disaster recovery and data protection for enterprise data. This enable production Oracle databases to survive disasters and data corruptions. Oracle 18c and 19c offers many new features it will bring many advantages to organization.
This document provides an overview of database performance tuning with a focus on SQL Server. It begins with background on the author and history of databases. It then covers topics like indices, queries, execution plans, transactions, locking, indexed views, partitioning, and hardware considerations. Examples are provided throughout to illustrate concepts. The goal is to present mostly vendor-independent concepts with a "SQL Server flavor".
The document discusses various ways to improve client/server performance at both the client and server level. It addresses:
1) Client performance can be improved by optimizing hardware and software. Hardware optimizations include using the fastest available components, while software optimizations involve improving the operating system and applications.
2) Server performance can also be improved through hardware upgrades like adding network cards, as well as implementing high-performance file systems and offloading processing to servers.
3) Database performance optimizations involve efficient index design, query design, and database normalization to minimize network traffic and process data faster.
إدارة السجلات
يمكنك إدارة السجلات في الجداول من خلال عرض ورقة البيانات. يشرح هذا القسم كيفية إضافة, تحديث, و حذف السجلات,
و أيضا كيفية البحث, الفرز, و تصفية السجلات عندما تحتاج الى العمل مع السجلات التي تناسب معايير مخصصة.
يشرح هذا القسم أيضا كيفية إلحاق سجلات الى جدول موجود.
Protect and maintain databases
حماية و صيانة قواعد البيانات
1. ضغط و اصلاح قاعدة البيانات تساعدنا في تحسين أداء قاعدة البيانات و اصلاح الملف عند حدوث المشاكل.
2. تشفير قاعدة البيانات بتطبيق كلمة مرور لتقييد الوصول, فقط المستخدمون الذين يعرفون كلمة المرور يستطيعون الوصول الى قاعدة البيانات.
3. العمل مع النسخ الاحتياطي.
4. دمج قواعد البيانات.
5. تقسيم قاعدة البيانات و هي خطوة تطبق خصيصا للمشاركة مع عدة مستخدمين.
إنشاء الاستعلامات الإجرائية
تشرح الأقسام الثلاثة المقبلة أنواع مختلفة من الاستعلامات الإجرائية:
استعلام تكوين جدول، استعلام إلحاقي، و استعلامات التحديث و الحذف.
غالبا ما تستخدم الاستعلامات الإجرائية للمساعدة في إدارة السجلات في قاعدة
البيانات. على سبيل المثال، يمكنك استخدام استعلام تحديد لاسترداد السجلات
لجميع المنتجات المتوقفة. يمكنك استخدام-تكوين جدول أو استعلام إلحاقي لأرشفة
تلك السجلات، ثم قم بتشغيل استعلام حذف على جدول المنتجات لإزالة سجلات
لتلك المنتجات.
The document describes MarketLine's Advantage platform, which provides subscribers access to company, industry, financial and country data from a single interactive interface. Advantage allows users to search across the entire data library and access information from anywhere via keyword searches. Much of the data is presented graphically so it can be easily integrated into projects and presentations. The platform also includes tools to extract data into Excel, view methodologies, contact analysts for assistance, and access additional help features.
- SQL code is loaded into RAM for parsing during a hard parse, while a soft parse does not require reloading into RAM.
- Excessive hard parsing can occur when the shared pool size is too small or queries contain non-reusable SQL statements without bind variables.
- Using bind variables rather than concatenating values into the SQL statement allows for soft parsing rather than hard parsing, improving performance by reducing parsing time and memory usage.
This document discusses database performance tuning and query optimization. It covers basic concepts like minimizing I/O operations to improve performance. The key phases of query processing are parsing, execution, and fetching. During parsing, the optimizer determines the most efficient execution plan. Indexes are also important for performance, as they allow more efficient data access than scanning rows. The document provides an overview of how a database management system processes queries and some common techniques for performance tuning.
Print and export databases
طباعة و تصدير قاعدة البيانات
يمكنك استخدام البيانات التي تخزنها في برنامج
الأكسيس بعدة طرق. في برنامج الأكسيس يمكنك
إنشاء التقارير على سبيل المثال يمكنك نشر التقارير
لطباعتها أو تنسيقها الكترونيا بطرق مختلفة. يمكنك
أيضا تصدير البيانات الى تنسيقات متوافقة مع نسخ
سابقة أو الى برامج أخرى منها الاكسيل و الورد.
يركز هذا القسم على طباعة التقارير و كيفية تصدير
البيانات من الأكسيس باختيارك لعدة تنسيقات.
1) The document describes the basic commands of SQL including data types, data definition language (DDL) for creating and modifying tables, data manipulation language (DML) for insert, update, delete statements, and select statements with functions and parameters.
2) It also covers SQL security commands for creating users and granting/revoking permissions, and transaction management with commit and rollback.
3) Examples are provided for creating tables with columns, primary keys, foreign keys and check constraints, and performing queries, updates, deletes and transactions on data.
Azure SQL Database is just SQL Server under the covers. However, there are some distinctive differences and new functionality. This session covers some of the new tools and methods available to help you make you Azure SQL Database Run as fast as possible.
The document discusses database normalization. It defines three normal forms: first normal form requires each cell to contain a single value and records to be unique; second normal form requires all non-key fields to depend on the whole primary key; third normal form requires all non-key fields to depend only on the primary key. An example shows a database normalized to third normal form, with the postal code moved to its own table since other fields depend on it rather than just the primary key. The summary is to normalize data such that all non-key columns depend only on the primary key.
Investigate SQL Server Memory Like Sherlock Holmes
The document discusses optimizing memory usage in SQL Server. It covers how SQL Server uses memory, including the buffer pool and plan cache. It discusses different memory models and settings like max server memory. It provides views and queries to monitor memory usage and pressure, and describes techniques to intentionally create internal memory pressure to encourage plan cache churn.
The document discusses troubleshooting performance issues for SQL Server. It begins with an introduction and case study on the MS Society of Canada's website. It then discusses optimizing the environment, using Performance Monitor (PerfMon) to monitor performance, and concludes with recommendations to address issues like high CPU usage, slow disk speeds, and insufficient memory.
Dynamic management views and functions in SQL Server provide information to monitor server health, diagnose issues, and tune performance. There are server-scoped and database-scoped DMVs. Common DMV categories include database, execution, I/O, index, and operating system. The Performance Monitor tool in Windows collects counters related to physical disk, memory, CPU, and network usage to identify bottlenecks. High disk queue lengths, low available memory, or high processor utilization could indicate performance issues.
This document discusses tuning a system for optimal performance. It covers determining performance criteria, analyzing problems, testing solutions, and signs of a well-tuned system. Key aspects of tuning include analyzing system usage, determining causes of problems, setting goals to improve throughput or response times, and testing changes. Memory, processors, I/O, and network usage should be optimized to avoid bottlenecks.
This document discusses SQL Server troubleshooting and performance monitoring. It begins with the basics of using tools like logs, Performance Monitor, traces, and third-party applications. It emphasizes starting monitoring before issues arise to establish baselines and identify bottlenecks. Common issues involve memory, processors, disks, queries, and maintenance. Specific performance counters are outlined to monitor these resources. Other troubleshooting aids discussed include dynamic management views, trace flags, and the Profiler tool. The roles of different database instances and importance of database design and queries are also covered.
This document discusses various techniques for optimizing MariaDB server performance, including:
- Tuning configuration settings like the buffer pool size, query cache size, and thread pool settings.
- Monitoring server metrics like CPU usage, memory usage, disk I/O, and MariaDB-specific metrics.
- Analyzing slow queries with the slow query log and EXPLAIN statements to identify optimization opportunities like adding indexes.
This document discusses various factors that impact the performance of QAD application and provides recommendations for tuning them. It describes how CPU utilization, memory allocation, disk I/O, checkpoints, latches and other resources can affect performance if not optimized. Specific metrics like buffer hits, resource waits, latch counts and timeouts are identified to monitor performance. Parameters like CPU count, buffer pool size, APW count, block size and before image settings can be tuned to improve efficiency.
This document describes a set of Progress OE parameters and show how they can impact a Progress OE database performance.
I wrote this document by an easy way so every one can understand it even if he's not a Progress OE DB administrator.
Pre and post tips to installing sql server correctly
Antonios Chatzipavlis is a database architect and SQL Server expert with over 30 years of experience working with SQL Server. The document provides tips for installing and configuring SQL Server correctly, including selecting the appropriate server hardware, installing Windows, configuring disks and storage, installing and configuring SQL Server, and creating user databases. The goal is to optimize performance and reliability based on best practices.
This session introduces tools that can help you analyze and troubleshoot performance with SharePoint 2013. This sessions presents tools like perfmon, Fiddler, Visual Round Trip Analyzer, IIS LogParser, Developer Dashboard and of course we create Web and Load Tests in Visual Studio 2013.
At the end we also take a look at some of the tips and best practices to improve performance on SharePoint 2013.
Architetture Serverless con SQL Server e Azure Functions
L'architettura serverless va sempre più di moda e innovative tecnologie come le Azure Functions ci consentono di implementarla facilmente. Come possiamo calare in questa realtà un prodotto consolidato come SQL Server che all'apparenza sembra non essere tagliato per questi scenari? In questa sessione vedremo come sfruttare SQL Server e l'estensibilità delle Azure Functions per costruire solutioni Serverless.
Sessione tenuta il 11/06/2021 a SQL Start 2021.
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
This document discusses tuning Linux and PostgreSQL for performance. It recommends:
- Tuning Linux kernel parameters like huge pages, swappiness, and overcommit memory. Huge pages can improve TLB performance.
- Tuning PostgreSQL parameters like shared_buffers, work_mem, and checkpoint_timeout. Shared_buffers stores the most frequently accessed data.
- Other tips include choosing proper hardware, OS, and database based on workload. Tuning queries and applications can also boost performance.
This document discusses MySQL performance tuning and various MySQL products and features. It provides information on MySQL 5.6 including improved scalability, new InnoDB features for NoSQL access, and an improved optimizer. It also discusses MySQL Enterprise Monitor for performance monitoring, and the Performance Schema for instrumentation and monitoring internal operations.
Predicates allow filtering events based on:
- Event properties (fields)
- Session properties
- System properties
They are evaluated synchronously when the event fires. This allows filtering events and reducing overhead compared to capturing all events.
Common predicates:
- event_name = 'sql_statement_completed'
- database_id = 5
- cpu_time > 1000
Predicates give granular control over what events are captured.
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
If you’re asking yourself the following questions when it comes to optimally running your MySQL or MariaDB databases:
- How do I tune them to make best use of the hardware?
- How do I optimize the Operating System?
- How do I best configure MySQL or MariaDB for a specific database workload?
Then this replay is for you!
We discuss some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL or MariaDB database. We also cover some of the variables which are frequently modified even though they should not.
Performance tuning is not easy, especially if you’re not an experienced DBA, but you can go a surprisingly long way with a few basic guidelines.
This webinar builds upon blog posts by Krzysztof from the ‘Become a MySQL DBA’ series.
AGENDA
- What to tune and why?
- Tuning process
- Operating system tuning
- Memory
- I/O performance
- MySQL configuration tuning
- Memory
- I/O performance
- Useful tools
- Do’s and do not’s of MySQL tuning
- Changes in MySQL 8.0
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
This document provides an overview of performance tuning the MySQL server. It discusses where to find server configuration and status information, how to analyze what the database is doing using status variables, and which configuration variables can be tuned for optimization, including global, per-session, and storage engine variables. Key areas covered include memory usage, query analysis, indexing strategies, and tuning storage engines like InnoDB and MyISAM.
This document provides best practices for optimizing Blackboard Learn performance. It recommends deploying for performance from the start, optimizing platform components continuously through measurements, using scalable deployments like 64-bit architectures and virtualization, improving page responsiveness through techniques like gzip compression and image optimization, optimizing the web server, Java Virtual Machine, and database through configuration and tools. It emphasizes the importance of understanding resource utilization, wait events, execution plans, and statistics/histograms for database optimization.
The document discusses performance tuning topics in WebLogic Server including tuning EJBs, JMS, web applications, web services, and JDBC. It provides guidance on understanding performance objectives such as anticipated users, requests, data, and target CPU utilization. It also discusses monitoring disk and CPU utilization, data transfers across networks, and locating bottlenecks in the system. Specific tuning recommendations are provided for EJBs, MDB pools, stateless session bean pools, entity bean pools, and JMS.
This document provides an overview of using Polybase for data virtualization in SQL Server. It discusses installing and configuring Polybase, connecting external data sources like Azure Blob Storage and SQL Server, using Polybase DMVs for monitoring and troubleshooting, and techniques for optimizing performance like predicate pushdown and creating statistics on external tables. The presentation aims to explain how Polybase can be leveraged to virtually access and query external data using T-SQL without needing to know the physical data locations or move the data.
Antonios Chatzipavlis presented on SQL Server backup and restore. The presentation covered database architecture basics including data files, transaction log files, and the buffer cache. It also discussed backup types like full, differential, transaction log, copy only and partial backups. Backup strategies and restore processes were explained, including restoring to a point in time and restoring system databases. The internals of how SQL Server performs backups using buffers and I/O threads was also summarized.
Antonios Chatzipavlis presented on migrating SQL workloads to Azure. He discussed modernizing data platforms by discovering, assessing, planning, transforming, optimizing, testing and remediating. Key migration considerations include remaining, rehosting, refactoring, rearchitecting, rebuilding or replacing workloads. Tools for migrating data include Microsoft Assessment and Planning Toolkit, Data Migration Assistant, Database Experimentation Assistant, SQL Server Migration Assistant, and Azure Database Migration Service. Workloads can be migrated to Azure VMs, Azure SQL Databases or Azure SQL Managed Instances.
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
From the noted database expert and author of 'SQL in a Nutshell' - SELECT statements have a reputation for being very easy to write, but hard to write very well. This session will take you through ten of the most problematic patterns and anti-patterns when writing queries and how to deal with them all. Loaded with live demonstrations and useful techniques, this session will teach you how to take your SQL Server queries mundane to masterful.
This document discusses Oracle database performance tuning. It covers identifying common Oracle performance issues such as CPU bottlenecks, memory issues, and inefficient SQL statements. It also outlines the Oracle performance tuning method and tools like the Automatic Database Diagnostic Monitor (ADDM) and performance page in Oracle Enterprise Manager. These tools help administrators monitor performance, identify bottlenecks, implement ADDM recommendations, and tune SQL statements reactively when issues arise.
The document discusses MySQL architecture and concepts. It describes the application layer where users interact with the MySQL database. It then explains the logical layer which includes subsystems like the query processor, transaction management, recovery management and storage management that work together to process requests. Key concepts like concurrency control, locks, transactions, storage engines and InnoDB/MyISAM are also overviewed.
Analyzing big data quickly and efficiently requires a data warehouse optimized to handle and scale for large datasets. Amazon Redshift is a fast, petabyte-scale data warehouse that makes it simple and cost-effective to analyze big data for a fraction of the cost of traditional data warehouses. In this session, we take an in-depth look at data warehousing with Amazon Redshift for big data analytics. We cover best practices to take advantage of Amazon Redshift's columnar technology and parallel processing capabilities to deliver high throughput and query performance. We also discuss how to design optimal schemas, load data efficiently, and use work load management.
Session aims at introducing less familiar audience to the Oracle database statistics concept, why statistics are necessary and how the Oracle Cost-Based Optimizer uses them
The document discusses SQL Server monitoring and troubleshooting. It provides an overview of SQL Server monitoring, including why it is important and common monitoring tools. It also describes the SQL Server threading model, including threads, schedulers, states, the waiter list, and runnable queue. Methods for using wait statistics like the DMVs sys.dm_os_waiting_tasks and sys.dm_os_wait_stats are presented. Extended Events are introduced as an alternative to SQL Trace. The importance of establishing a performance baseline is also noted.
Microsoft SQL Server internals & architectureKevin Kline
From noted SQL Server expert and author Kevin Kline - Let’s face it. You can effectively do many IT jobs related to Microsoft SQL Server without knowing the internals of how SQL Server works. Many great developers, DBAs, and designers get their day-to-day work completed on time and with reasonable quality while never really knowing what’s happening behind the scenes. But if you want to take your skills to the next level, it’s critical to know SQL Server’s internal processes and architecture. This session will answer questions like:
- What are the various areas of memory inside of SQL Server?
- How are queries handled behind the scenes?
- What does SQL Server do with procedural code, like functions, procedures, and triggers?
- What happens during checkpoints? Lazywrites?
- How are IOs handled with regards to transaction logs and database?
- What happens when transaction logs and databases grow or shrinks?
This fast paced session will take you through many aspects of the internal operations of SQL Server and, for those topics we don’t cover, will point you to resources where you can get more information.
Database tuning is the process of optimizing a database to maximize performance. It involves activities like configuring disks, tuning SQL statements, and sizing memory properly. Database performance issues commonly stem from slow physical I/O, excessive CPU usage, or latch contention. Tuning opportunities exist at the level of database design, application code, memory settings, disk I/O, and eliminating contention. Performance monitoring tools like the Automatic Workload Repository and wait events help identify problem areas.
Advanced SQL covers selecting columns, aggregate functions like MIN() and MAX(), the CASE WHEN statement, JOINs, the WHERE clause, GROUP BY, declaring variables, and subqueries
Meta/Facebook's database serving social workloads is running on top of MyRocks (MySQL on RocksDB). This means our performance and reliability depends a lot on RocksDB. Not just MyRocks, but also we have other important systems running on top of RocksDB. We have learned many lessons from operating and debugging RocksDB at scale.
In this session, we will offer an overview of RocksDB, key differences from InnoDB, and share a few interesting lessons learned from production.
The document discusses various disaster recovery strategies for SQL Server including failover clustering, database mirroring, and peer-to-peer transactional replication. It provides advantages and disadvantages of each approach. It also outlines the steps to configure replication for Always On Availability Groups which involves setting up publications and subscriptions, configuring the availability group, and redirecting the original publisher to the listener name.
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
The document provides an overview of Oracle database performance tuning best practices for DBAs and developers. It discusses the connection between SQL tuning and instance tuning, and how tuning both the database and SQL statements is important. It also covers the connection between the database and operating system, how features like data integrity and zero downtime updates are important. The presentation agenda includes topics like identifying bottlenecks, benchmarking, optimization techniques, the cost-based optimizer, indexes, and more.
This document discusses AlwaysOn availability technologies in SQL Server 2017, including Failover Cluster Instances (FCI) and Availability Groups (AG). It provides an overview of how FCI and AG work to provide high availability and disaster recovery, including capabilities like multi-subnet support. The document also summarizes new features and enhancements to FCI and AG in SQL Server 2014, 2016 and 2017.
- Oracle Database is a comprehensive, integrated database management system that provides an open approach to information management.
- The Oracle architecture includes database structures like data files, control files, and redo log files as well as memory structures like the system global area (SGA) and process global area (PGA).
- Key components of the Oracle architecture include the database buffer cache, shared pool, redo log buffer, and background processes that manage instances.
The document provides guidance on understanding and optimizing database performance. It emphasizes the importance of properly designing schemas, normalizing data, using appropriate data types, and creating useful indexes. Explain plans should be used to test queries and identify optimization opportunities like adding missing indexes. Overall, the document encourages developers to view the database as a collaborative "friend" rather than an enemy, by understanding its capabilities and limitations.
MS SQL Server is a database server produced by Microsoft that enables users to write and execute SQL queries and statements. It consists of several features like Query Analyzer, Profiler, and Service Manager. Multiple instances of SQL Server can be installed on a machine, with each instance having its own set of users, databases, and other objects. SQL Server uses data files, filegroups, and transaction logs to store database objects and record transactions. The data dictionary contains metadata about database schemas and is stored differently in Oracle and SQL Server.
The document discusses how the PostgreSQL query planner works. It explains that a query goes through several stages including parsing, rewriting, planning/optimizing, and execution. The optimizer or planner has to estimate things like the number of rows and cost to determine the most efficient query plan. Statistics collected by ANALYZE are used for these estimates but can sometimes be inaccurate, especially for n_distinct values. Increasing the default_statistics_target or overriding statistics on columns can help address underestimation issues. The document also discusses different plan types like joins, scans, and aggregates that the planner may choose between.
This document provides guidance on tuning MySQL for optimal performance. It discusses adjusting various configuration settings related to I/O, memory allocation, query caching, and InnoDB settings. Tuning aspects like I/O, queries, maintenance and configurations are recommended to maximize speed within the constraints of other services. Transaction logs and temporary file storage especially impact performance as heavy consumers of I/O.
Performance Tuning With Oracle ASH and AWR. Part 1 How And Whatudaymoogala
The document discusses various techniques for identifying and analyzing SQL performance issues in an Oracle database, including gathering diagnostic data from AWR reports, ASH reports, SQL execution plans, and real-time SQL monitoring reports. It provides an overview of how to use these tools to understand what is causing performance problems by identifying what is slow, quantifying the impact, determining the component involved, and analyzing the root cause.
Oracle Data Guard ensures high availability, disaster recovery and data protection for enterprise data. This enable production Oracle databases to survive disasters and data corruptions. Oracle 18c and 19c offers many new features it will bring many advantages to organization.
This document provides an overview of database performance tuning with a focus on SQL Server. It begins with background on the author and history of databases. It then covers topics like indices, queries, execution plans, transactions, locking, indexed views, partitioning, and hardware considerations. Examples are provided throughout to illustrate concepts. The goal is to present mostly vendor-independent concepts with a "SQL Server flavor".
Performance tuning and optimization (ppt)Harish Chand
The document discusses various ways to improve client/server performance at both the client and server level. It addresses:
1) Client performance can be improved by optimizing hardware and software. Hardware optimizations include using the fastest available components, while software optimizations involve improving the operating system and applications.
2) Server performance can also be improved through hardware upgrades like adding network cards, as well as implementing high-performance file systems and offloading processing to servers.
3) Database performance optimizations involve efficient index design, query design, and database normalization to minimize network traffic and process data faster.
إدارة السجلات
يمكنك إدارة السجلات في الجداول من خلال عرض ورقة البيانات. يشرح هذا القسم كيفية إضافة, تحديث, و حذف السجلات,
و أيضا كيفية البحث, الفرز, و تصفية السجلات عندما تحتاج الى العمل مع السجلات التي تناسب معايير مخصصة.
يشرح هذا القسم أيضا كيفية إلحاق سجلات الى جدول موجود.
Protect and maintain databases
حماية و صيانة قواعد البيانات
1. ضغط و اصلاح قاعدة البيانات تساعدنا في تحسين أداء قاعدة البيانات و اصلاح الملف عند حدوث المشاكل.
2. تشفير قاعدة البيانات بتطبيق كلمة مرور لتقييد الوصول, فقط المستخدمون الذين يعرفون كلمة المرور يستطيعون الوصول الى قاعدة البيانات.
3. العمل مع النسخ الاحتياطي.
4. دمج قواعد البيانات.
5. تقسيم قاعدة البيانات و هي خطوة تطبق خصيصا للمشاركة مع عدة مستخدمين.
إنشاء الاستعلامات الإجرائية
تشرح الأقسام الثلاثة المقبلة أنواع مختلفة من الاستعلامات الإجرائية:
استعلام تكوين جدول، استعلام إلحاقي، و استعلامات التحديث و الحذف.
غالبا ما تستخدم الاستعلامات الإجرائية للمساعدة في إدارة السجلات في قاعدة
البيانات. على سبيل المثال، يمكنك استخدام استعلام تحديد لاسترداد السجلات
لجميع المنتجات المتوقفة. يمكنك استخدام-تكوين جدول أو استعلام إلحاقي لأرشفة
تلك السجلات، ثم قم بتشغيل استعلام حذف على جدول المنتجات لإزالة سجلات
لتلك المنتجات.
The document describes MarketLine's Advantage platform, which provides subscribers access to company, industry, financial and country data from a single interactive interface. Advantage allows users to search across the entire data library and access information from anywhere via keyword searches. Much of the data is presented graphically so it can be easily integrated into projects and presentations. The platform also includes tools to extract data into Excel, view methodologies, contact analysts for assistance, and access additional help features.
- SQL code is loaded into RAM for parsing during a hard parse, while a soft parse does not require reloading into RAM.
- Excessive hard parsing can occur when the shared pool size is too small or queries contain non-reusable SQL statements without bind variables.
- Using bind variables rather than concatenating values into the SQL statement allows for soft parsing rather than hard parsing, improving performance by reducing parsing time and memory usage.
This document discusses database performance tuning and query optimization. It covers basic concepts like minimizing I/O operations to improve performance. The key phases of query processing are parsing, execution, and fetching. During parsing, the optimizer determines the most efficient execution plan. Indexes are also important for performance, as they allow more efficient data access than scanning rows. The document provides an overview of how a database management system processes queries and some common techniques for performance tuning.
Print and export databases
طباعة و تصدير قاعدة البيانات
يمكنك استخدام البيانات التي تخزنها في برنامج
الأكسيس بعدة طرق. في برنامج الأكسيس يمكنك
إنشاء التقارير على سبيل المثال يمكنك نشر التقارير
لطباعتها أو تنسيقها الكترونيا بطرق مختلفة. يمكنك
أيضا تصدير البيانات الى تنسيقات متوافقة مع نسخ
سابقة أو الى برامج أخرى منها الاكسيل و الورد.
يركز هذا القسم على طباعة التقارير و كيفية تصدير
البيانات من الأكسيس باختيارك لعدة تنسيقات.
1) The document describes the basic commands of SQL including data types, data definition language (DDL) for creating and modifying tables, data manipulation language (DML) for insert, update, delete statements, and select statements with functions and parameters.
2) It also covers SQL security commands for creating users and granting/revoking permissions, and transaction management with commit and rollback.
3) Examples are provided for creating tables with columns, primary keys, foreign keys and check constraints, and performing queries, updates, deletes and transactions on data.
Azure SQL Database is just SQL Server under the covers. However, there are some distinctive differences and new functionality. This session covers some of the new tools and methods available to help you make you Azure SQL Database Run as fast as possible.
The document discusses database normalization. It defines three normal forms: first normal form requires each cell to contain a single value and records to be unique; second normal form requires all non-key fields to depend on the whole primary key; third normal form requires all non-key fields to depend only on the primary key. An example shows a database normalized to third normal form, with the postal code moved to its own table since other fields depend on it rather than just the primary key. The summary is to normalize data such that all non-key columns depend only on the primary key.
Investigate SQL Server Memory Like Sherlock HolmesRichard Douglas
The document discusses optimizing memory usage in SQL Server. It covers how SQL Server uses memory, including the buffer pool and plan cache. It discusses different memory models and settings like max server memory. It provides views and queries to monitor memory usage and pressure, and describes techniques to intentionally create internal memory pressure to encourage plan cache churn.
The document discusses troubleshooting performance issues for SQL Server. It begins with an introduction and case study on the MS Society of Canada's website. It then discusses optimizing the environment, using Performance Monitor (PerfMon) to monitor performance, and concludes with recommendations to address issues like high CPU usage, slow disk speeds, and insufficient memory.
Dmv's & Performance Monitor in SQL ServerZeba Ansari
Dynamic management views and functions in SQL Server provide information to monitor server health, diagnose issues, and tune performance. There are server-scoped and database-scoped DMVs. Common DMV categories include database, execution, I/O, index, and operating system. The Performance Monitor tool in Windows collects counters related to physical disk, memory, CPU, and network usage to identify bottlenecks. High disk queue lengths, low available memory, or high processor utilization could indicate performance issues.
This document discusses tuning a system for optimal performance. It covers determining performance criteria, analyzing problems, testing solutions, and signs of a well-tuned system. Key aspects of tuning include analyzing system usage, determining causes of problems, setting goals to improve throughput or response times, and testing changes. Memory, processors, I/O, and network usage should be optimized to avoid bottlenecks.
This document discusses SQL Server troubleshooting and performance monitoring. It begins with the basics of using tools like logs, Performance Monitor, traces, and third-party applications. It emphasizes starting monitoring before issues arise to establish baselines and identify bottlenecks. Common issues involve memory, processors, disks, queries, and maintenance. Specific performance counters are outlined to monitor these resources. Other troubleshooting aids discussed include dynamic management views, trace flags, and the Profiler tool. The roles of different database instances and importance of database design and queries are also covered.
MariaDB Server Performance Tuning & OptimizationMariaDB plc
This document discusses various techniques for optimizing MariaDB server performance, including:
- Tuning configuration settings like the buffer pool size, query cache size, and thread pool settings.
- Monitoring server metrics like CPU usage, memory usage, disk I/O, and MariaDB-specific metrics.
- Analyzing slow queries with the slow query log and EXPLAIN statements to identify optimization opportunities like adding indexes.
This document discusses various factors that impact the performance of QAD application and provides recommendations for tuning them. It describes how CPU utilization, memory allocation, disk I/O, checkpoints, latches and other resources can affect performance if not optimized. Specific metrics like buffer hits, resource waits, latch counts and timeouts are identified to monitor performance. Parameters like CPU count, buffer pool size, APW count, block size and before image settings can be tuned to improve efficiency.
This document describes a set of Progress OE parameters and show how they can impact a Progress OE database performance.
I wrote this document by an easy way so every one can understand it even if he's not a Progress OE DB administrator.
Antonios Chatzipavlis is a database architect and SQL Server expert with over 30 years of experience working with SQL Server. The document provides tips for installing and configuring SQL Server correctly, including selecting the appropriate server hardware, installing Windows, configuring disks and storage, installing and configuring SQL Server, and creating user databases. The goal is to optimize performance and reliability based on best practices.
This session introduces tools that can help you analyze and troubleshoot performance with SharePoint 2013. This sessions presents tools like perfmon, Fiddler, Visual Round Trip Analyzer, IIS LogParser, Developer Dashboard and of course we create Web and Load Tests in Visual Studio 2013.
At the end we also take a look at some of the tips and best practices to improve performance on SharePoint 2013.
Architetture Serverless con SQL Server e Azure FunctionsMassimo Bonanni
L'architettura serverless va sempre più di moda e innovative tecnologie come le Azure Functions ci consentono di implementarla facilmente. Come possiamo calare in questa realtà un prodotto consolidato come SQL Server che all'apparenza sembra non essere tagliato per questi scenari? In questa sessione vedremo come sfruttare SQL Server e l'estensibilità delle Azure Functions per costruire solutioni Serverless.
Sessione tenuta il 11/06/2021 a SQL Start 2021.
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedEqunix Business Solutions
This document discusses tuning Linux and PostgreSQL for performance. It recommends:
- Tuning Linux kernel parameters like huge pages, swappiness, and overcommit memory. Huge pages can improve TLB performance.
- Tuning PostgreSQL parameters like shared_buffers, work_mem, and checkpoint_timeout. Shared_buffers stores the most frequently accessed data.
- Other tips include choosing proper hardware, OS, and database based on workload. Tuning queries and applications can also boost performance.
This document discusses MySQL performance tuning and various MySQL products and features. It provides information on MySQL 5.6 including improved scalability, new InnoDB features for NoSQL access, and an improved optimizer. It also discusses MySQL Enterprise Monitor for performance monitoring, and the Performance Schema for instrumentation and monitoring internal operations.
Predicates allow filtering events based on:
- Event properties (fields)
- Session properties
- System properties
They are evaluated synchronously when the event fires. This allows filtering events and reducing overhead compared to capturing all events.
Common predicates:
- event_name = 'sql_statement_completed'
- database_id = 5
- cpu_time > 1000
Predicates give granular control over what events are captured.
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningSeveralnines
If you’re asking yourself the following questions when it comes to optimally running your MySQL or MariaDB databases:
- How do I tune them to make best use of the hardware?
- How do I optimize the Operating System?
- How do I best configure MySQL or MariaDB for a specific database workload?
Then this replay is for you!
We discuss some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL or MariaDB database. We also cover some of the variables which are frequently modified even though they should not.
Performance tuning is not easy, especially if you’re not an experienced DBA, but you can go a surprisingly long way with a few basic guidelines.
This webinar builds upon blog posts by Krzysztof from the ‘Become a MySQL DBA’ series.
AGENDA
- What to tune and why?
- Tuning process
- Operating system tuning
- Memory
- I/O performance
- MySQL configuration tuning
- Memory
- I/O performance
- Useful tools
- Do’s and do not’s of MySQL tuning
- Changes in MySQL 8.0
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
This document provides an overview of performance tuning the MySQL server. It discusses where to find server configuration and status information, how to analyze what the database is doing using status variables, and which configuration variables can be tuned for optimization, including global, per-session, and storage engine variables. Key areas covered include memory usage, query analysis, indexing strategies, and tuning storage engines like InnoDB and MyISAM.
This document provides best practices for optimizing Blackboard Learn performance. It recommends deploying for performance from the start, optimizing platform components continuously through measurements, using scalable deployments like 64-bit architectures and virtualization, improving page responsiveness through techniques like gzip compression and image optimization, optimizing the web server, Java Virtual Machine, and database through configuration and tools. It emphasizes the importance of understanding resource utilization, wait events, execution plans, and statistics/histograms for database optimization.
The document discusses performance tuning topics in WebLogic Server including tuning EJBs, JMS, web applications, web services, and JDBC. It provides guidance on understanding performance objectives such as anticipated users, requests, data, and target CPU utilization. It also discusses monitoring disk and CPU utilization, data transfers across networks, and locating bottlenecks in the system. Specific tuning recommendations are provided for EJBs, MDB pools, stateless session bean pools, entity bean pools, and JMS.
This document provides an overview of using Polybase for data virtualization in SQL Server. It discusses installing and configuring Polybase, connecting external data sources like Azure Blob Storage and SQL Server, using Polybase DMVs for monitoring and troubleshooting, and techniques for optimizing performance like predicate pushdown and creating statistics on external tables. The presentation aims to explain how Polybase can be leveraged to virtually access and query external data using T-SQL without needing to know the physical data locations or move the data.
Antonios Chatzipavlis presented on SQL Server backup and restore. The presentation covered database architecture basics including data files, transaction log files, and the buffer cache. It also discussed backup types like full, differential, transaction log, copy only and partial backups. Backup strategies and restore processes were explained, including restoring to a point in time and restoring system databases. The internals of how SQL Server performs backups using buffers and I/O threads was also summarized.
Antonios Chatzipavlis presented on migrating SQL workloads to Azure. He discussed modernizing data platforms by discovering, assessing, planning, transforming, optimizing, testing and remediating. Key migration considerations include remaining, rehosting, refactoring, rearchitecting, rebuilding or replacing workloads. Tools for migrating data include Microsoft Assessment and Planning Toolkit, Data Migration Assistant, Database Experimentation Assistant, SQL Server Migration Assistant, and Azure Database Migration Service. Workloads can be migrated to Azure VMs, Azure SQL Databases or Azure SQL Managed Instances.
This document summarizes a webinar presentation about workload management in SQL Server 2019. It discusses how SQL Server's Resource Governor feature can be used to provide multitenancy, predictable performance, and isolation for multiple workloads running on a single SQL Server instance. Key concepts covered include resource pools, workload groups, and classification functions to assign sessions to different pools and groups. The presentation also reviews best practices for using lookup tables in classification functions and shows some DMVs for monitoring Resource Governor configuration and statistics.
This document provides an overview of loading data into Azure SQL DW (Synapse Analytics). It discusses extracting source data into text files, landing the data into Azure Data Lake Store Gen2, preparing the data for loading into staging tables using PolyBase or COPY commands, transforming the data, and inserting it into production tables. It also compares ETL vs ELT approaches and SSIS vs Azure Data Factory for data integration. The presenter then demonstrates loading data in Synapse SQL pool and invites any questions.
The document provides an overview of the DAX language. It discusses that DAX is the programming language used in Power BI, Power Pivot, and Analysis Services for data modeling, reporting, and analytics. It describes the basic components of a DAX data model including tables, columns, relationships, measures, and hierarchies. It also covers DAX syntax, functions, operators, and how context and filter context work in DAX calculations and queries.
The document introduces Diagnostic Management Views (DMVs) and Dynamic Management Functions (DMFs) in SQL Server. It discusses that DMVs and DMFs return server state information and can be used to monitor server health, diagnose problems, and tune performance. It provides examples of common DMVs and DMFs used for query execution and the query plan cache. Finally, it notes that the presentation will demonstrate troubleshooting with DMVs and DMFs.
This document summarizes common T-SQL anti-patterns that can negatively impact query performance, including using SELECT *, functions in predicates, OR operators, implicit conversions, unnecessary sorts, correlated subqueries, and dynamic SQL execution. The presentation provides explanations of why each anti-pattern hurts performance and recommendations for more optimized alternatives such as using indexes, temporary tables, parameterization, and execution plan analysis.
This document discusses designing a modern data warehouse in Azure. It provides an overview of traditional vs. self-service data warehouses and their limitations. It also outlines challenges with current data warehouses around timeliness, flexibility, quality and findability. The document then discusses why organizations need a modern data warehouse based on criteria like customer experience, quality assurance and operational efficiency. It covers various approaches to ingesting, storing, preparing and modeling data in Azure. Finally, it discusses architectures like the lambda architecture and common data models.
Modernizing Your Database with SQL Server 2019 discusses SQL Server 2019 features that can help modernize a database, including:
- The Hybrid Buffer Pool which supports persistent memory to improve performance on read-heavy workloads.
- Memory-Optimized TempDB Metadata which stores TempDB metadata in memory-optimized tables to avoid certain blocking issues.
- Intelligent Query Processing features like Adaptive Query Processing, Batch Mode processing on rowstores, and Scalar UDF Inlining which improve query performance.
- Approximate Count Distinct, a new function that provides an estimated count of distinct values in a column faster than a precise count.
- Lightweight profiling, enabled by default, which provides query plan
This document discusses designing a modern data warehouse in Azure. It provides an overview of traditional vs. self-service data warehouses and their limitations. It also outlines challenges with current data warehouses around timeliness, flexibility, quality and findability. The document then discusses why organizations need a modern data warehouse based on criteria like customer experience, quality assurance and operational efficiency. It covers various approaches to ingesting, storing, preparing, modeling and serving data on Azure. Finally, it discusses architectures like the lambda architecture and common data models.
The document provides details about an SQL expert's background and certifications. It summarizes the expert's career starting in 1982 working with computers and 1988 starting in the computer industry. In 1996, they started working with SQL Server 6.0 and have since earned multiple Microsoft certifications. The expert now provides training and consultation services, and created an online school called SQL School Greece to teach SQL Server.
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Antonios Chatzipavlis
Azure SQL Database is a managed database service hosted in Microsoft's Azure cloud. Some key differences from SQL Server include: the service is paid by the hour based on the selected service tier; users can dynamically scale resources up or down; backups and high availability are managed by the service provider; and common administration tasks are handled by the provider rather than the user. The service offers automatic backups, point-in-time restore, and geo-restore capabilities along with built-in high availability through replication across three copies in the primary region.
The document discusses technologies within the Microsoft SQL family and Azure SQL that can help organizations address requirements of the General Data Protection Regulation (GDPR). It covers features for discovering and classifying personal data, managing access and controlling how data is used, and protecting data through encryption, auditing and other security controls. Built-in technologies like dynamic data masking, row-level security, authentication options, and transparent data encryption are described as ways SQL Server and Azure SQL Database can help organizations comply with GDPR.
The document provides biographical information about Antonios Chatzipavlis, a SQL Server expert and evangelist. It then summarizes his presentation on statistics and index internals in SQL Server, which covers topics like cardinality estimation, inspecting and updating statistics, index structure and types, and identifying missing indexes. The presentation includes demonstrations of analyzing cardinality estimation and picking the right index key.
This document provides an introduction and overview of Azure Data Lake. It describes Azure Data Lake as a single store of all data ranging from raw to processed that can be used for reporting, analytics and machine learning. It discusses key Azure Data Lake components like Data Lake Store, Data Lake Analytics, HDInsight and the U-SQL language. It compares Data Lakes to data warehouses and explains how Azure Data Lake Store, Analytics and U-SQL process and transform data at scale.
This document provides an overview of Azure SQL Data Warehouse. It discusses what Azure SQL Data Warehouse is, how it is provisioned and scaled, best practices for designing tables in Azure SQL DW including distribution keys and data types, and methods for loading and querying data including PolyBase and labeling queries for monitoring. The presentation also covers tuning aspects like statistics, indexing, and resource classes.
This document provides an introduction and overview of Azure DocumentDB. It discusses how DocumentDB is a fully managed NoSQL database service that provides fast and predictable performance for JSON data through SQL querying capabilities. It also describes how DocumentDB offers features like elastic scaling, high availability, global distribution and ease of development. The document then provides information on starting with DocumentDB, writing queries, and programming capabilities within DocumentDB like stored procedures and triggers.
Performance Budgets for the Real World by Tammy EvertsScyllaDB
Performance budgets have been around for more than ten years. Over those years, we’ve learned a lot about what works, what doesn’t, and what we need to improve. In this session, Tammy revisits old assumptions about performance budgets and offers some new best practices. Topics include:
• Understanding performance budgets vs. performance goals
• Aligning budgets with user experience
• Pros and cons of Core Web Vitals
• How to stay on top of your budgets to fight regressions
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/07/intels-approach-to-operationalizing-ai-in-the-manufacturing-sector-a-presentation-from-intel/
Tara Thimmanaik, AI Systems and Solutions Architect at Intel, presents the “Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” tutorial at the May 2024 Embedded Vision Summit.
AI at the edge is powering a revolution in industrial IoT, from real-time processing and analytics that drive greater efficiency and learning to predictive maintenance. Intel is focused on developing tools and assets to help domain experts operationalize AI-based solutions in their fields of expertise.
In this talk, Thimmanaik explains how Intel’s software platforms simplify labor-intensive data upload, labeling, training, model optimization and retraining tasks. She shows how domain experts can quickly build vision models for a wide range of processes—detecting defective parts on a production line, reducing downtime on the factory floor, automating inventory management and other digitization and automation projects. And she introduces Intel-provided edge computing assets that empower faster localized insights and decisions, improving labor productivity through easy-to-use AI tools that democratize AI.
An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)
In this follow-up session on knowledge and prompt engineering, we will explore structured prompting, chain of thought prompting, iterative prompting, prompt optimization, emotional language prompts, and the inclusion of user signals and industry-specific data to enhance LLM performance.
Join EIS Founder & CEO Seth Earley and special guest Nick Usborne, Copywriter, Trainer, and Speaker, as they delve into these methodologies to improve AI-driven knowledge processes for employees and customers alike.
How to Avoid Learning the Linux-Kernel Memory ModelScyllaDB
The Linux-kernel memory model (LKMM) is a powerful tool for developing highly concurrent Linux-kernel code, but it also has a steep learning curve. Wouldn't it be great to get most of LKMM's benefits without the learning curve?
This talk will describe how to do exactly that by using the standard Linux-kernel APIs (locking, reference counting, RCU) along with a simple rules of thumb, thus gaining most of LKMM's power with less learning. And the full LKMM is always there when you need it!
How Netflix Builds High Performance Applications at Global ScaleScyllaDB
We all want to build applications that are blazingly fast. We also want to scale them to users all over the world. Can the two happen together? Can users in the slowest of environments also get a fast experience? Learn how we do this at Netflix: how we understand every user's needs and preferences and build high performance applications that work for every user, every time.
AC Atlassian Coimbatore Session Slides( 22/06/2024)apoorva2579
This is the combined Sessions of ACE Atlassian Coimbatore event happened on 22nd June 2024
The session order is as follows:
1.AI and future of help desk by Rajesh Shanmugam
2. Harnessing the power of GenAI for your business by Siddharth
3. Fallacies of GenAI by Raju Kandaswamy
Transcript: Details of description part II: Describing images in practice - T...BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
Video traffic on the Internet is constantly growing; networked multimedia applications consume a predominant share of the available Internet bandwidth. A major technical breakthrough and enabler in multimedia systems research and of industrial networked multimedia services certainly was the HTTP Adaptive Streaming (HAS) technique. This resulted in the standardization of MPEG Dynamic Adaptive Streaming over HTTP (MPEG-DASH) which, together with HTTP Live Streaming (HLS), is widely used for multimedia delivery in today’s networks. Existing challenges in multimedia systems research deal with the trade-off between (i) the ever-increasing content complexity, (ii) various requirements with respect to time (most importantly, latency), and (iii) quality of experience (QoE). Optimizing towards one aspect usually negatively impacts at least one of the other two aspects if not both. This situation sets the stage for our research work in the ATHENA Christian Doppler (CD) Laboratory (Adaptive Streaming over HTTP and Emerging Networked Multimedia Services; https://athena.itec.aau.at/), jointly funded by public sources and industry. In this talk, we will present selected novel approaches and research results of the first year of the ATHENA CD Lab’s operation. We will highlight HAS-related research on (i) multimedia content provisioning (machine learning for video encoding); (ii) multimedia content delivery (support of edge processing and virtualized network functions for video networking); (iii) multimedia content consumption and end-to-end aspects (player-triggered segment retransmissions to improve video playout quality); and (iv) novel QoE investigations (adaptive point cloud streaming). We will also put the work into the context of international multimedia systems research.
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
Are you interested in learning about creating an attractive website? Here it is! Take part in the challenge that will broaden your knowledge about creating cool websites! Don't miss this opportunity, only in "Redesign Challenge"!
Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data.
The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs.
Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution!
Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfjackson110191
These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.
1. Performance Tuning in SQL Server
Antonios Chatzipavlis
Software Architect , Development Evangelist, IT Consultant
MCT, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS, MCAD, MCP, OCA
1
2. Objectives
•
•
•
•
•
Why is Performance Tuning Necessary?
How to Optimize SQL Server for performance
How to Optimize Database for performance
How to Optimize Query for performance
Define and implement monitoring standards for database
servers and instances
• How to troubleshoot SQL Server
2
4. Why is Performance Tuning Necessary?
• Allowing your system to scale
• Adding more customers
• Adding more features
• Improve overall system performance
• Save money but not wasting resources
• The database is typically one of the most expensive resources
in a datacenter
4
5. General Scaling Options
Scaling SQL Server with Bigger Hardware
•
•
•
•
Purchase a larger server, and replace the existing system.
Works well with smaller systems.
Cost prohibitive for larger systems.
Can be a temporary solution.
5
6. General Scaling Options
Scaling SQL Server with More Hardware
• Purchase more hardware and split or partition the database.
• Partitioning can be either vertical or horizontal
• Vertical: Split the databases based on a specific demographic
such as time zone or zip code.
• Horizontal: Split components out of one database into another
6
7. General Scaling Options
Scaling SQL Server without adding hardware
•
•
•
•
•
•
•
•
Adjusting and rewriting queries.
Adding indexes.
Removing indexes.
Re-architecting the database schema.
Moving things that shouldn’t be in the database.
Eliminating redundant work on the database.
Caching of data.
Other performance tuning techniques.
7
11. CPU and SQL Server
• CPU Intensive Operations
• Compression
• Bulk Load operations
• Compiling or Recompiling Queries
• Hyper-Threading
• Is just 1.3 times better than non hyper-threaded execution
• The currently accepted best practice recommendation is that
you should run SQL Server with Hyper-Threading disabled
• L3 Cache
11
12. CPU and SQL Server
Performance Counters
Counter
Description
Guidelines
Processor:% Processor
Time
This counter monitors the amount of
time the CPU spends executing a thread
that is not idle
A consistent state of 80 percent to 90
percent may indicate the need to
upgrade your CPU or add more
processors.
System: %Total Processor
To determine the average for all
processors
Processor: % Privileged
Time
Corresponds to the percentage of time
the processor spends on execution of
Microsoft Windows kernel commands,
such as processing of SQL Server I/O
requests.
Processor: %User Time
Corresponds to the percentage of time
that the processor spends on
executing user processes such as SQL
Server.
System: Processor Queue
Length
Corresponds to the number of threads
waiting for processor time. A processor
bottleneck develops when threads of a
process require more processor cycles
than are available.
If this counter is consistently high when
the Physical Disk counters are high,
consider installing a faster or more
efficient disk subsystem.
If more than a few processes attempt to
utilize the processor's time, you might
need to install a faster processor. Or, if
you have a multiprocessor system, you
could add a processor.
12
13. Memory and SQL Server
Enable Address Windowing Extensions (AWE)
• Tuning 32-bit Systems
• Use /PAE and /3GB Together (Windows 2003)
• Running BCDEDIT /set increaseUserVA 3072 (Windows 2008)
• Tuning 64-bit Systems
• If needed, enable AWE on Enterprise Edition of SQL Server
• If needed, enable AWE on Standard Edition of SQL Server only when
SP1 with Cumulative Update 2 applied.
Read more info at http://support.microsoft.com/kb/970070
13
14. Memory and SQL Server
Min and Max Server Memory
• Control the allowable size of SQL Server’s buffer pool.
• Do not control all of SQL Server’s memory usage, just the
buffer pool.
• When the SQL Server service starts, it does not acquire all
the memory configured in Min Server Memory but instead
starts with only the minimal required, growing as necessary.
• Once memory usage has increased beyond the Min Server
Memory setting, SQL Server won’t release any memory
below that figure.
• Max Server Memory is the opposite of Min Server Memory,
setting a “ceiling” for the buffer pool
14
15. Memory and SQL Server
How to configure Max Server Memory
• Look at the buffer pool’s maximum usage.
• Set SQL Server to dynamically manage memory
• Monitor MSSQLSERVER : Memory ManagerTotal Server Memory
(KB) counter using Performance Monitor
• Determine the maximum potential for non-buffer pool usage.
• 2GB for Windows
• xGB for SQL Server worker threads
• Each thread use 0.5MB on x86, 2MB on x64, and 4MB on Itanium.
• 1GB for multi-page allocations, linked servers, and other consumers
of memory outside the buffer pool
• 1–3GB for other applications that might be running on the system,
such as backup programs
15
16. Memory and SQL Server
Example of Max Server Memory configuration
• In 8-CPU cores and 16GB of RAM running SQL Server 2008
x64 and a third-party backup utility, you would allow the
following:
•
•
•
•
2GB for Windows
1GB for worker threads (576 Χ 2MB rounded down)
1GB for MPAs, etc.
1GB for the backup program
• The total is 5GB, and you would configure Max Server
Memory to 11GB.
16
17. Memory and SQL Server
Performance Counters
Counter
Description
Guidelines
Memory: Available Bytes
Indicates how many any bytes of memory are
currently available for use by Processes
Low values can indicate that there is an overall
shortage of memory on computer or that an
application is not releasing memory
Memory: Pages/sec
Indicates the number of pages that either
were retrieved from disk due to hard page
faults or written to disk to free space in the
working set due to page faults.
A high rate could indicate excessive paging.
Monitor the Memory: Page Faults/sec counter
to make sure that the disk activity is not caused
by paging.
Process - Page Faults/sec
(sql server instance)
Windows Virtual Memory
Manager takes pages from SQL Server and
other processes as it trims the working-set
sizes of those processes.
A high number indicates excessive paging and
disk thrashing. Use this counter to check
whether SQL Server or another process is
causing the excessive paging.
SQL Server: Buffer ManagerBuffer Cache Hit Ratio
Monitors the percentage of required pages
found in the buffer cache, without reading
from hard disk.
Add more memory until the value is consistently
greater than 90 percent.
SQL Server: Buffer ManagerTotal Pages
Monitors the total number of pages in the
buffer cache, including database, free, and
stolen pages from other processes.
A low number may indicate frequent disk I/O or
thrashing. Consider adding more memory.
SQL Server: Memory ManagerTotal Server Memory (KB)
Monitors the total amount of dynamic
memory that the server is using.
If this counter is consistently high in comparison
to the amount of physical memory available,
more memory may be required.
17
18. IO and SQL Server
Choose the right hard disk subsystem
• RAID 5
•
•
•
•
Loved by storage administrators
Dominated choice for non-database applications
It’s cost effective and cost efficient
Minimize the space required in the datacenter (fewer drives need
fewer bays)
• RAID 10
• Microsoft recommendation for log files
• Storage Area Networks (SANs)
• Performance is not always predictable if two servers share the same
drive
• iSCSI Storage Area Networks
• For good performance needs dedicated switches.
18
19. IO and SQL Server
Choosing Which Files to Place on Which Disks
• Best practices dictate that SQL Server
•
•
•
•
data files,
logs,
tempdb files
backup files
are all written to separate arrays
• Put log files on RAID 10
• Put data files on RAID 5 (to save money)
19
20. IO and SQL Server
Using Compression to Gain Performance
• Increase IO performance but has CPU penalty
• The SQL Server engine has to compress the data before
writing the page, and decompress the data after reading the
page
• However, in practice this penalty is far outweighed by the
time saved waiting for storage. Read more at
http://msdn.microsoft.com/en-us/library/dd894051.aspx
• Example: If a 10GB index is compressed down to 3GB, then
an index scan will be completed 70% faster simply because
the data takes less time to read off the drives.
• Is Enterprise Edition feature
20
21. IO and SQL Server
Performance Counters
Counter
Description
Guidelines
% Disk Time
Monitors the percentage of time that
the disk is busy with read/write activity.
If this counter is high (more than 90
percent), check the Current Disk Queue
Length counter.
Avg. Disk Queue Length
Monitors the average number of
read/write requests that are queued.
This counter should be no more than
twice the number of spindles.
Current Disk Queue Length
Monitors the current number of
read/write requests that are queued.
This counter should be no more than
twice the number of spindles
• Monitor the Page Faults/sec counter in the Memory object
to make sure that the disk activity is not caused by paging.
• If you have more than one logical partition on the same hard
disk, use the Logical Disk counters rather than the Physical
Disk counters.
21
25. Schema Design Optimization
Normalization
• In this process you organize data to minimize redundancy,
which eliminates duplicated data and logical ambiguities in
the database
Normal Form
Description
First
Every attribute is atomic, and there are no
repeating groups
Second
Complies with First Normal Form, and all non-key
columns depend on the whole key
Third
Complies with Second Normal Form, and all nonkey columns are non-transitively dependent upon
the primary key
25
26. Schema Design Optimization
Denormalization
• In this process you re-introduce redundancy to the database
to optimize performance.
• When to use denormalization:
• To pre-aggregate data
• To avoid multiple/complex joins
• When not to use denormalization:
• To prevent simple joins
• To provide reporting data
• To prevent same row calculations
26
27. Schema Design Optimization
Generalization
• In this process you group similar entities together into a
single entity to reduce the amount of required data access
code.
• Use generalization when:
• A large number of entities appear to be of the same type
• Multiple entities contain the same attributes
• Do not use generalization when:
• It results in an overly complex design that is difficult to
manage
27
30. Key Measures for Query Performance
Key factors for query performance:
Resources used to execute the query
Time required for query execution
SQL Server tools to measure query performance:
Performance Monitor
SQL Server Profiler
30
32. Logical Execution of Query
Example Data
customerid city
Orderid customerid
ANTON
Athens
1
NASOS
CHRIS
Salonica
2
NASOS
FANIS
Athens
3
FANIS
NASOS
Athens
4
FANIS
5
FANIS
6
CHRIS
7
NULL
32
33. Logical Execution of Query
Example Query & Results
SELECT C.customerid, COUNT(O.orderid) AS numorders
FROM dbo.Customers AS C
LEFT OUTER JOIN dbo.Orders AS O
ON C.customerid = O.customerid
WHERE C.city = 'Athens'
GROUP BY C.customerid
HAVING COUNT(O.orderid) < 3
ORDER BY numorders;
Customerid
numorders
ANTON
0
NASOS
2
33
34. Logical Execution of Query
1st Step - Cross Join
FROM dbo.Customers AS C ... JOIN dbo.Orders AS O
Customerid
City
Orderid
customerid
ANTON
Athens
1
NASOS
ANTON
Athens
2
NASOS
ANTON
Athens
3
FANIS
ANTON
Athens
4
FANIS
ANTON
Athens
5
FANIS
ANTON
Athens
6
CHRIS
ANTON
Athens
7
NULL
CHRIS
Salonica
1
NASOS
CHRIS
Salonica
2
NASOS
CHRIS
Salonica
3
FANIS
CHRIS
Salonica
4
FANIS
CHRIS
Salonica
5
FANIS
CHRIS
Salonica
6
CHRIS
CHRIS
Salonica
7
NULL
FANIS
Athens
1
NASOS
FANIS
Athens
2
NASOS
FANIS
Athens
3
FANIS
FANIS
Athens
4
FANIS
FANIS
Athens
5
FANIS
FANIS
Athens
6
CHRIS
FANIS
Athens
7
NULL
NASOS
Athens
1
NASOS
NASOS
Athens
2
NASOS
NASOS
Athens
3
FANIS
NASOS
Athens
4
FANIS
NASOS
Athens
5
FANIS
NASOS
Athens
6
CHRIS
NASOS
Athens
7
NULL
34
35. Logical Execution of Query
2nd Step- Apply Join condition ON Filter
ON C.customerid = O.customerid
Customerid
City
Orderid
customerid
ΟΝ Filter
ANTON
Athens
1
NASOS
FALSE
ANTON
Athens
2
NASOS
FALSE
ANTON
Athens
3
FANIS
FALSE
ANTON
Athens
4
FANIS
FALSE
ANTON
Athens
5
FANIS
FALSE
ANTON
Athens
6
CHRIS
FALSE
ANTON
Athens
7
NULL
UNKNOWN
CHRIS
Salonica
1
NASOS
FALSE
CHRIS
Salonica
2
NASOS
FALSE
CHRIS
Salonica
3
FANIS
FALSE
CHRIS
Salonica
4
FANIS
FALSE
CHRIS
Salonica
5
FANIS
FALSE
CHRIS
Salonica
6
CHRIS
TRUE
CHRIS
Salonica
7
NULL
UNKNOWN
FANIS
Athens
1
NASOS
FALSE
FANIS
Athens
2
NASOS
FALSE
FANIS
Athens
3
FANIS
TRUE
FANIS
Athens
4
FANIS
TRUE
FANIS
Athens
5
FANIS
TRUE
FANIS
Athens
6
CHRIS
FALSE
FANIS
Athens
7
NULL
UNKNOWN
NASOS
Athens
1
NASOS
TRUE
NASOS
Athens
2
NASOS
TRUE
NASOS
Athens
3
FANIS
FALSE
NASOS
Athens
4
FANIS
FALSE
NASOS
Athens
5
FANIS
FALSE
NASOS
Athens
6
CHRIS
FALSE
NASOS
Athens
7
NULL
UNKNOWN
Customerid
City
Orderid
customerid
CHRIS
Salonica
6
CHRIS
FANIS
Athens
3
FANIS
FANIS
Athens
4
FANIS
FANIS
Athens
5
FANIS
NASOS
Athens
1
NASOS
NASOS
Athens
2
NASOS
35
36. Logical Execution of Query
3rd Step - Apply OUTER Join
FROM dbo.Customers AS C LEFT OUTER JOIN
dbo.Orders AS O
Customerid
City
Orderid
customerid
CHRIS
Salonica
6
CHRIS
FANIS
Athens
3
FANIS
FANIS
Athens
4
FANIS
FANIS
Athens
5
FANIS
NASOS
Athens
1
NASOS
NASOS
Athens
2
NASOS
ΑΝΤΟΝ
Athens
NULL
NULL
36
45. Logical Execution of Query
Get the Result
Customerid
numorders
ANTON
0
NASOS
2
45
46. Performance Tuning in SQL Server
How to Optimize Query for performance
Top 10 for Building Efficient Queries
46
47. Top 10 for Building Efficient Queries
1.Favor set-based logic over procedural or cursor logic
• The most important factor to consider when tuning queries
is how to properly express logic in a set-based manner.
• Cursors or other procedural constructs limit the query
optimizer’s ability to generate flexible query plans.
• Cursors can therefore reduce the possibility of performance
improvements in many situations
47
48. Top 10 for Building Efficient Queries
2.Test query variations for performance
• The query optimizer can often produce widely different
plans for logically equivalent queries.
• Test different techniques, such as joins or subqueries, to
find out which perform better in various situations.
48
49. Top 10 for Building Efficient Queries
3.Avoid query hints.
• You must work with the SQL Server query optimizer, rather
than against it, to create efficient queries.
• Query hints tell the query optimizer how to behave and
therefore override the optimizer’s ability to do its job
properly.
• If you eliminate the optimizer’s choices, you might limit
yourself to a query plan that is less than ideal.
• Use query hints only when you are absolutely certain that
the query optimizer is incorrect.
49
50. Top 10 for Building Efficient Queries
4.Use correlated subqueries to improve performance.
• Since the query optimizer is able to integrate subqueries
into the main query flow in a variety of ways, subqueries
might help in various query tuning situations.
• Subqueries can be especially useful in situations in which
you create a join to a table only to verify the existence of
correlated rows. For better performance, replace these
kinds of joins with correlated subqueries that make use of
the EXISTS operator
--Using a LEFT JOIN
SELECT a.parent_key FROM parent_table a LEFT JOIN child_table b ON a.parent_key =
b.parent_key WHERE B.parent_key IS NULL
--Using a NOT EXISTS
SELECT a.parent_key FROM parent_table a WHERE NOT EXISTS (SELECT * FROM child_table b
WHERE a.parent_key =b.parent_key)
50
51. Top 10 for Building Efficient Queries
5. Avoid using a scalar user-defined function in the
WHERE clause.
• Scalar user-defined functions, unlike scalar subqueries, are
not optimized into the main query plan.
• Instead, you must call them row-by-row by using a hidden
cursor.
• This is especially troublesome in the WHERE clause because
the function is called for every input row.
• Using a scalar function in the SELECT list is much less
problematic because the rows have already been filtered in
the WHERE clause.
51
52. Top 10 for Building Efficient Queries
6.Use table-valued user-defined functions as
derived tables.
• In contrast to scalar user-defined functions, table-valued
functions are often helpful from a performance point of
view when you use them as derived tables.
• The query processor evaluates a derived table only once per
query.
• If you embed the logic in a table-valued user-defined
function, you can encapsulate and reuse it for other queries.
CREATE FUNCTION Sales.fn_SalesByStore (@storeid int)
RETURNS TABLE AS RETURN
(
SELECT P.ProductID, P.Name, SUM(SD.LineTotal) AS 'YTD Total‘ FROM Production.Product AS P
JOIN Sales.SalesOrderDetail AS SD ON SD.ProductID = P.ProductID JOIN Sales.SalesOrderHeader AS SH
ON SH.SalesOrderID = SD.SalesOrderID WHERE SH.CustomerID = @storeid GROUP BY P.ProductID, P.Name
)
52
53. Top 10 for Building Efficient Queries
7.Avoid unnecessary GROUP BY columns
• Use a subquery instead.
• The process of grouping rows becomes more expensive as
you add more columns to the GROUP BY list.
• If your query has few column aggregations but many nonaggregated grouped columns, you might be able to refactor
it by using a correlated scalar subquery.
• This will result in less work for grouping in the query and
therefore possibly better overall query performance.
SELECT p1.ProductSubcategoryID, p1.Name
FROM Production.Product p1 WHERE p1.ListPrice >
( SELECT AVG (p2.ListPrice) FROM Production.Product p2
WHERE p1.ProductSubcategoryID =
p2.ProductSubcategoryID)
53
54. Top 10 for Building Efficient Queries
8.Use CASE expressions to include variable
logic in a query
• The CASE expression is one of the most powerful logic tools
available to T-SQL programmers.
• Using CASE, you can dynamically change column output on a
row-by-row basis.
• This enables your query to return only the data that is
absolutely necessary and therefore reduces the I/O
operations and network overhead that is required to
assemble and send large result sets to clients.
54
55. Top 10 for Building Efficient Queries
9. Divide joins into temporary tables when you query
very large tables.
• The query optimizer’s main strategy is to find query plans that
satisfy queries by using single operations.
• Although this strategy works for most cases, it can fail for larger
sets of data because the huge joins require so much I/O
overhead.
• In some cases, a better option is to reduce the working set by
using temporary tables to materialize key parts of the query. You
can then join the temporary tables to produce a final result.
• This technique is not favorable in heavily transactional systems
because of the overhead of temporary table creation, but it can
be very useful in decision support situations.
55
56. Top 10 for Building Efficient Queries
10. Refactoring Cursors into Queries.
•
Rebuild logic as multiple queries
•
Rebuild logic as a user-defined function
•
Rebuild logic as a complex query with a case expression
56
59. Stored Procedures
Best Practices
• Avoid using “sp_” as name prefix
• Avoid stored procedures that accept parameters for table
names
• Use the SET NOCOUNT ON option in stored procedures
• Limit the use of temporary tables and table variables in
stored procedures
• If a stored procedure does multiple data modification
operations, make sure to enlist them in a transaction.
• When working with dynamic T-SQL, use sp_executesql
instead of the EXEC statement
60
60. Views
Best Practices
•
•
•
•
•
Use views to abstract complex data structures
Use views to encapsulate aggregate queries
Use views to provide more user-friendly column names
Think of reusability when designing views
Avoid using the ORDER BY clause in views that contain a TOP
100 PERCENT clause.
• Utilize indexes on views that include aggregate data
61
64. Guidelines for designing indexes
•
Examine the database characteristics.
For example, your indexing strategy will differ between an online transaction processing system with frequent data updates and a data
warehousing system that contains primarily read-only data.
•
Understand the characteristics of the most frequently used queries and the
columns used in the queries.
For example, you might need to create an index on a query that joins tables or that uses a unique column for its search argument.
•
Decide on the index options that might enhance the performance of the index.
Options that can affect the efficiency of an index include FILLFACTOR and ONLINE.
•
Determine the optimal storage location for the index.
You can choose to store a nonclustered index in the same filegroup as the table or on a different filegroup. If you store the index in a filegroup that
is on a different disk than the table filegroup, you might find that disk I/O performance improves because multiple disks can be read at the same
time.
•
Balance read and write performance in the database.
You can create many nonclustered indexes on a single table, but it is important to remember that each new index has an impact on the
performance of insert and update operations. This is because nonclustered indexes maintain copies of the indexed data. Each copy of the data
requires I/O operations to maintain it, and you might cause a reduction in write performance if the database has to write too many copies. You
must ensure that you balance the needs of both select queries and data updates when you design an indexing strategy.
•
Consider the size of tables in the database.
The query processor might take longer to traverse the index of a small table than to perform a simple table scan. Therefore, if you create an index
on a small table, the processor might never use the index. However, the database engine must still update the index when the data in the table
changes.
•
Consider the use of indexed views.
Indexes on views can provide significant performance gains when the view contains aggregations, table joins, or both.
65
65. Nonclustered Index
do’s & don’ts
•
Create a nonclustered index for columns used for:
•
Predicates
•
Joins
•
Aggregation
• Avoid the following when designing nonclustered indexes:
•
Redundant indexes
•
Wide composite indexes
•
Indexes for one query
•
Nonclustered indexes that include the clustered index
66
66. Clustered Indexes
do’s & don’ts
• Use clustered indexes for:
•
Range queries
•
Primary key queries
•
Queries that retrieve data from many columns
• Do not use clustered indexes for:
•
Columns that have frequent changes
•
Wide keys
67
68. Performance Tuning in SQL Server
Define and implement monitoring
standards for database servers and
instances
69
69. Monitoring Stages
Stage 1
Monitoring the database environment
Narrowing down a performance issue to a
particular database environment area
Stage 2
Stage 3
Narrowing down a performance issue to a
particular database environment object
Stage 4
Stage 5
Troubleshooting individual
problems
Implementing a
solution
70
70. Monitoring the database environment
• You must collect a broad range of performance data.
• The monitoring system must provide you with enough data to solve the
current performance issues.
• You must set up a monitoring solution that collects data from a broad
range of sources.
• Active data, you can use active collection tools
• System Monitor,
• Error Logs,
• SQL Server Profiler
• Inactive data you can use sources
• Database configuration settings,
• Server configuration settings,
• Metadata from SQL Server installation and databases
71
71. Guidelines for Auditing and Comparing
Test Results
• Scan the outputs gathered for any obvious performance
issues.
• Automate the analysis with the use of custom scripts and
tools.
• Analyze data soon after it is collected.
• Performance data has a short life span, and if there is a delay, the quality of the
analysis will suffer.
• Do not stop analyzing data when you discover the first set of
issues.
• Continue to analyze until all performance issues have been identified.
• Take into account the entire database environment when
you analyze performance data.
73
73. SQL Server Profiler guidelines
• Schedule data tracing for peak and nonpeak hours
• Use Transact-SQL to create your own SQL Server Profiler
traces to minimize the performance impact of SQL Server
Profiler.
• Do not collect the SQL Server Profiler traces directly into a
SQL Server table.
• After the trace has ended, use fn_trace_gettable function to load the data
into a table.
• Store collected data on a computer that is not the instance
that you are tracing.
75
74. System Monitor guidelines
• Execute System Monitor traces at different times during the
week, month.
• Collect data every 36 seconds for a week.
• If the data collection period spans more than a week, set the
collection time interval in the range of 300 to 600 seconds.
• Collect the data in a comma-delimited text file. You can load
this text file into SQL Server Profiler for further analysis.
• Execute System Monitor on one server to collect the
performance data of another server.
76
75. DMVs for Monitoring
DMV
Description
sys.dm_os_threads
Returns a list of all SQL Server Operating System threads
that are running under the SQL Server process.
sys.dm_os_memory_pools
Returns a row for each object store in the instance of SQL
Server. You can use this view to monitor cache memory
use and to identify bad caching behavior
sys.dm_os_memory_cache_counters
Returns a snapshot of the health of a cache, provides runtime information about the cache entries allocated, their
use, and the source of memory for the cache entries.
sys.dm_os_wait_stats
Returns information about all the waits encountered by
threads that executed. You can use this aggregated view
to diagnose performance issues with SQL Server and also
with specific queries and batches.
sys.dm_os_sys_info
Returns a miscellaneous set of useful information about
the computer, and about the resources available to and
consumed by SQL Server.
77
76. Performance Data Collector
• Management Data Warehouse
• Performance Data Collection
•
•
•
•
Performance data collection components
System collection sets
User-defined collection sets
Reporting
• Centralized Administration: Bringing it all together
Performance Data Collection and Reporting
78
80. Reduce Locking and Blocking
Guidelines
•
Keep logical transactions short
•
Avoid cursors
•
Use efficient and well-indexed queries
•
Use the minimum transaction isolation level required
•
Keep triggers to a minimum
82
81. Minimizing Deadlocks
•
•
•
•
•
Access objects in the same order.
Avoid user interaction in transactions.
Keep transactions short and in one batch.
Use a lower isolation level.
Use a row versioning–based isolation level.
• Set the READ_COMMITTED_SNAPSHOT database option ON to enable
read-committed transactions to use row versioning.
• Use snapshot isolation.
• Use bound connections.
• Allow two or more connections to share the same transaction and locks.
• Can work on the same data without lock conflicts.
• Can be created from multiple connections within the same application,
or from multiple applications with separate connections.
• Make coordinating actions across multiple connections easier.
• http://msdn.microsoft.com/en-us/library/aa213063(SQL.80).aspx
83
82. SQLschool.gr
• A dream
• Reliable source of knowledge for SQL Server
• http://www.autoexec.gr/blogs/antonch
84