This document discusses how to optimize SQL queries by removing bookmark lookups, RID lookups, and key lookups. These lookups occur when a query uses a non-clustered index to seek on columns in the WHERE clause, but must then perform further lookups to return non-key columns in the SELECT clause. The document demonstrates how to remove these lookups using two methods: 1) creating a non-clustered index that covers all columns in the query, or 2) creating an included column non-clustered index. Removing lookups in this way improves query performance.
There’s just so much to do to get your systems to run in an optimal fashion, but where do you start. This session will walk you through an extensive checklist of things you can do to better manage your servers, databases and code. We’ll start with server configurations and what you can do with them. We’ll then move through standard administrative tasks that will help with performance. Then it’s off to the intricacies of database design and how that can affect performance. We’ll finish up with T-SQL and where it can hurt or help your systems. Get your own systems to run faster with the information you’ll receive.
Developing Client-side Application using Visual Studio Code and NodejsRajesh Gunasundaram
Walk-through on creating and running a client-side application using Visual Studio Code and Nodejs. JavaScript Application using VS Code Editor and Managing Libraries using Nodejs and NPM package manager in Visual Studio Code. Detailed articles on www.ProgrammerGuide.Net
Uncovering SQL Server query problems with execution plans - Tony DavisRed Gate Software
Presentation by Tony Davis at SQL in The City 2016. An execution plan tells you exactly which tables and indexes SQL Server accessed, in what order, and what other operations it performed to return the data your query needed. But sometimes, the plan for even the simplest-looking query can reveal nasty surprises.
This session describes how SQL Server generates and reuses execution plans and the implications this has for you as the developer. After a quick-start guide to retrieving and reading plans, we'll focus on techniques that can help you track down high-cost queries quickly.
We'll cover tools such as ANTS Performance Profiler, as well as scripts that hunt down execution plans for queries that caused expensive scans, sort warnings, and other issues. Examining those plans, you'll uncover the root cause of the problem, often revealing issues such as inefficient indexing, data type mismatches, and misuse of functions.
Learn more about ANTS Performance Profiler: http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
Find out about all Redgate Products: http://www.red-gate.com/products/
Connect with Tony Davis on LinkedIn: https://www.linkedin.com/in/tony-davis-208b241
SQL Server Query Optimization, Execution and Debugging Query PerformanceVinod Kumar
This document summarizes a presentation on SQL Server query optimization, execution, and debugging query performance. The key takeaways are: 1) estimated row counts affect plan selection because the optimizer uses cardinality estimates to determine query plan costs; 2) tools like SSMS, DMVs, and tracing can be used to find estimated and actual row counts and compare query plans; 3) parameterized queries can cause issues if the plan is reused for parameter values that expected different plans. Techniques for influencing plan choice and testing considerations for parameterized queries are also discussed.
Sql server performance tuning and optimizationManish Rawat
Sql server performance tuning and optimization
SQL Server Concepts/Structure
Performance Measuring & Troubleshooting Tools
Locking
Performance Problem : CPU
Performance Problem : Memory
Performance Problem : I/O
Performance Problem : Blocking
Query Tuning
Indexing
Kudo Codefest: Faster data retrival with SQL query optimizationKudo Developers
At the beginning of Kudo, our data were simple. No too many transactions were created. As time goes by, our startup grew bigger and many data were flooding our database. As an impact, our queries became slow and the tables need many relations. To solve this problem, we need some approach to query our data faster and keep its performance so it won't bring our server down.
These slides were presented by Kudo CMS Team at Kudo Codefest 2016 Techtalk. They explained some tricks they were using to solve their query problems and how to optimize them. Their journey started from implementing the most simple trick to more complex approach. As a result, they could fetch a lot of data from our database without being overburdened with many request. Even though they never found the fastest query, there will always be a way to optimize the database.
Optimizing Query is very important to improve the performance of the database. Analyse query using query execution plan, create cluster index and non-cluster index and create indexed views
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.
There’s just so much to do to get your systems to run in an optimal fashion, but where do you start. This session will walk you through an extensive checklist of things you can do to better manage your servers, databases and code. We’ll start with server configurations and what you can do with them. We’ll then move through standard administrative tasks that will help with performance. Then it’s off to the intricacies of database design and how that can affect performance. We’ll finish up with T-SQL and where it can hurt or help your systems. Get your own systems to run faster with the information you’ll receive.
Developing Client-side Application using Visual Studio Code and NodejsRajesh Gunasundaram
Walk-through on creating and running a client-side application using Visual Studio Code and Nodejs. JavaScript Application using VS Code Editor and Managing Libraries using Nodejs and NPM package manager in Visual Studio Code. Detailed articles on www.ProgrammerGuide.Net
Uncovering SQL Server query problems with execution plans - Tony DavisRed Gate Software
Presentation by Tony Davis at SQL in The City 2016. An execution plan tells you exactly which tables and indexes SQL Server accessed, in what order, and what other operations it performed to return the data your query needed. But sometimes, the plan for even the simplest-looking query can reveal nasty surprises.
This session describes how SQL Server generates and reuses execution plans and the implications this has for you as the developer. After a quick-start guide to retrieving and reading plans, we'll focus on techniques that can help you track down high-cost queries quickly.
We'll cover tools such as ANTS Performance Profiler, as well as scripts that hunt down execution plans for queries that caused expensive scans, sort warnings, and other issues. Examining those plans, you'll uncover the root cause of the problem, often revealing issues such as inefficient indexing, data type mismatches, and misuse of functions.
Learn more about ANTS Performance Profiler: http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
Find out about all Redgate Products: http://www.red-gate.com/products/
Connect with Tony Davis on LinkedIn: https://www.linkedin.com/in/tony-davis-208b241
SQL Server Query Optimization, Execution and Debugging Query PerformanceVinod Kumar
This document summarizes a presentation on SQL Server query optimization, execution, and debugging query performance. The key takeaways are: 1) estimated row counts affect plan selection because the optimizer uses cardinality estimates to determine query plan costs; 2) tools like SSMS, DMVs, and tracing can be used to find estimated and actual row counts and compare query plans; 3) parameterized queries can cause issues if the plan is reused for parameter values that expected different plans. Techniques for influencing plan choice and testing considerations for parameterized queries are also discussed.
Sql server performance tuning and optimizationManish Rawat
Sql server performance tuning and optimization
SQL Server Concepts/Structure
Performance Measuring & Troubleshooting Tools
Locking
Performance Problem : CPU
Performance Problem : Memory
Performance Problem : I/O
Performance Problem : Blocking
Query Tuning
Indexing
Kudo Codefest: Faster data retrival with SQL query optimizationKudo Developers
At the beginning of Kudo, our data were simple. No too many transactions were created. As time goes by, our startup grew bigger and many data were flooding our database. As an impact, our queries became slow and the tables need many relations. To solve this problem, we need some approach to query our data faster and keep its performance so it won't bring our server down.
These slides were presented by Kudo CMS Team at Kudo Codefest 2016 Techtalk. They explained some tricks they were using to solve their query problems and how to optimize them. Their journey started from implementing the most simple trick to more complex approach. As a result, they could fetch a lot of data from our database without being overburdened with many request. Even though they never found the fastest query, there will always be a way to optimize the database.
Optimizing Query is very important to improve the performance of the database. Analyse query using query execution plan, create cluster index and non-cluster index and create indexed views
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.
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction Mark Ginnebaugh
Patrick Sheehan of Microsoft covers platform architecture, data warehousing methodology, and multi-dimensional cube development.
You will learn:
* How to develop and deploy data cubes using SQL Server Analysis Services (SSAS)
* Optimal data warehouse methodology for use with SSAS
* Tips/tricks for designing & building cubes over no warehouse/suboptimal source system (it happens)
* Cube processing types - How/why to use each
* Cube design practices + How to build and deploy cubes!
This document summarizes new features in SQL Server 2016 for SQL Server Integration Services (SSIS), Master Data Services (MDS), Data Quality Services (DQS), Analysis Services (SSAS), and Reporting Services (SSRS). For SSIS, new features include auto-adjusting buffer size, an Azure feature pack, and incremental package deployment. For MDS, improvements include longer attribute names, composite indexes, and entity synchronization. For SSAS, enhancements focus on performance, consistency, and new DAX functions. For SSRS, additions center around treemap/sunburst charts, custom parameters, and HTML5 rendering.
SQL Server Workshop for Developers - Visual Studio Live! NY 2012Andrew Brust
Here are the key enhancements to the OVER clause in SQL Server 2012:
- Ability to specify both PARTITION BY and ORDER BY clauses, allowing window functions to operate over ordered partitions of data. This enables more advanced windowing scenarios.
- New window frame specifications - RANGE and ROWS, which allow window functions to consider rows before and/or after the current row within the partition. This enables window functions like moving averages.
- Ability to use window functions with aggregate functions like SUM(), COUNT(), etc. This allows calculations like cumulative sums within partitions.
- Performance improvements for window functions through optimizations like push-down of predicates and better parallelization.
So in summary, SQL Server 2012 significantly expands the
Why you should be mining your data and how to actually do it. Every company needs a rock star. We want it to be you. This session will give real world examples of data mining successes as well as walk you through how to get started down the path of data enlightenment, so that you too can say "I Am A Data Miner℠".
Database administrators are responsible for maintaining high performance of databases like Oracle, SQL Server, and Red Hat that support enterprise applications like Blackboard. Quest Software's Spotlight tool helps administrators monitor and diagnose performance issues across various database platforms in real-time and historically. It provides visualizations of process flows, metrics, and alerts to identify bottlenecks and root causes of poor performance. Spotlight supports various database environments including Oracle, Oracle RAC, and SQL Server databases.
Nivedita Alure seeks a position as a SQL DBA with over 1.6 years of experience in SQL Server administration and MSBI development. She has expertise in SQL Server installation, configuration, backup/recovery, security, and performance tuning. She is proficient in T-SQL, SSIS, SSRS, and has experience developing ETL processes and reports. Her educational qualifications include a BE in Telecommunication and she has strong technical, analytical, and problem-solving skills.
Migrating on premises workload to azure sql databasePARIKSHIT SAVJANI
This document provides an overview of migrating databases from on-premises SQL Server to Azure SQL Database Managed Instance. It discusses why companies are moving to the cloud, challenges with migration, and the tools and services available to help with assessment and migration including Data Migration Service. Key steps in the migration workflow include assessing the database and application, addressing compatibility issues, and deploying the converted schema to Managed Instance which provides high compatibility with on-premises SQL Server in a fully managed platform as a service model.
Amit Sharma is a database administrator with over 7 years of experience managing MySQL databases. He has expertise in areas like database replication, performance tuning, backup/recovery, and Linux administration. Currently working as a database administrator at GetIt Stores, his previous roles include database administrator and junior software engineer positions. He holds a B.Tech in Computer Science and seeks to utilize his skills and experience in database management.
Getahun Gebremariam is seeking a position as a SQL Server DBA and has over 3 years of experience providing 24/7 support on production and non-production environments. He has expertise in SQL Server 2005/2008/2012/2014, Windows Server 2008/2012, and ETL tools like SSIS, SSAS, and SSRS. His responsibilities have included database administration tasks like performance monitoring and optimization, high availability configuration, backup and restore, and index management. He is proficient in T-SQL, database maintenance and has experience migrating data between SQL Server and Oracle databases.
Trivadis TechEvent 2017 Oracle to My SQL Migration - Challenges by Robert Bia...Trivadis
Migration from one database engine to another one for existing applications is not a trivial task. There are a lot of technical challenges, including but not limited to database features, object/data types and different behavior. In this presentation we would like to talk about a customer PoC, with the goal to migrate as many databases from Oracle to MySQL as possible. This includes categorization of several hundred Oracle databases into migration classes, based on custom criteria, as well as tool development to support schema (DDL) conversion and data migration.
This document contains the resume of Hemanth Kumar, who is a SQL Server DBA with over 4 years of experience working as a DBA for various companies including Unisys India Pvt Ltd and IMS Health. He has skills in installing, configuring, monitoring and troubleshooting Microsoft SQL Server. Some of his responsibilities as a DBA include managing backups, monitoring disk space, security management, performance optimization through index creation, and implementing high availability options such as log shipping and database mirroring. He is looking for a challenging SQL Server role to utilize his technical expertise.
This document provides an overview of an online training program for Oracle SQL. It covers topics like database basics, how databases work, what SQL is and why it is needed. The training will provide hands-on lab exercises and real-time guidance from instructors. It aims to help students learn SQL skills and prepare for placements in database jobs.
SQL SERVER|MASTERS offers SQL Server DBA training in Chennai taught by experienced experts. The training covers topics like the history of SQL Server, installation, configuration, security management, backup and recovery, database replication, job scheduling, performance monitoring, and performance tuning. Attendees will learn from a famous DBA specialist who has solved problems for many companies. For more details on the training, contact +91-9052666559 or visit www.sqlservermasters.com.
Geek Sync | Locating and Resolving Common Database Performance Issues in Micr...IDERA Software
You can watch the replay for this Geek Sync webcast in the IDERA Resource Center: http://ow.ly/8wTs50A5bgc
No database professional can afford to avoid performance issues, no matter how big or small. What best practices are you following?
Join IDERA and Devin Gallagher on Thursday, November 2 at 4 PM CT as he walks through locating and resolving common database performance issues. Devin will explore hot objects, poor performing SQL, missing or bad indexes and more. Catch an inside look into DB Optimizer with a technical specialist and learn how it successfully automates SQL tuning and profiling, and locates and resolves many of your common and not-so-common performance issues. Devin will also look at some performance drill down areas within Aqua Data Studio.
Attending PASS Summit? This will be a special live Geek Sync you will not want to miss in Booth 112.
Ponmagal N is a Database Administrator with over 2 years of experience in SQL Server database administration, development, and maintenance. She has extensive experience with SQL Server 2008/2012, T-SQL, SSIS, and SSRS. Some of her responsibilities include database design, query and stored procedure development, performance tuning, backup and recovery procedures, and report development. She has worked on projects involving a time tracking application, a mobile app, and providing database support for an insurance company. Ponmagal holds a PG Diploma in VLSI and Embedded Hardware Design and a Bachelor's Degree in Electrical and Electronics Engineering.
PL SQLDay Machine Learning- Hands on ML.NET.pptxLuis Beltran
The document provides an overview of a presentation on machine learning with ML.NET. It discusses machine learning concepts and workflows, how to use ML.NET to build models with .NET, and integrating ML.NET with other Microsoft technologies like Azure ML and TensorFlow. The agenda includes machine learning, ML.NET, the ML workflow, data preparation, model training, evaluation and deployment, and deep learning.
NoSQL Database: Classification, Characteristics and ComparisonMayuree Srikulwong
My students' presentation of a paper "NoSQL Database: New Era of Databases for Big Data Analytics - Classification, Characteristics and Comparison" by Moniruzzaman, A.B.M. and Hossain, S.A. (2013).
Lakshmi Srinivas Pallapothu is a software engineer with 3 years of experience in SQL Server development, BI tools like SSIS, SSRS and SSAS, and .NET technologies. He has expertise in ETL development, data warehousing, report generation and web application development. Currently he works as a software engineer at OSI Technologies handling projects for clients like NCH Marketing Services and Prologic Redemption Solutions.
The document discusses obtaining a connection to a database in Java using JDBC. It provides code examples of creating a database connection using the DriverManager class and Oracle's JDBC Thin driver. The code inserts a record into an EMP table for demonstration purposes. Best practices for database connectivity in a Java project are then covered, such as using the DAO pattern to separate data access logic from business logic. This improves testability, reusability and flexibility in switching database types.
This document provides information about an upcoming SQL Saturday Night event on March 30, 2013 that will focus on using T-SQL. The presentation will be recorded so that those unable to attend can view it later. Attendees are asked to change their virtual cards to a specific color if they are unable to hear the presenter. The presentation will be free and begin in 1 minute.
What is your sql server backup strategy tech_republicKaing Menglieng
The document discusses various SQL Server backup strategies including full backups, differential backups, transaction log backups, and file group backups. It explains how to implement each strategy using either SQL Server Enterprise Manager graphical user interface or Transact SQL commands. Full backups create a complete picture of the database, differential backups back up only changed data since the last full backup, transaction log backups back up transactions and allow point-in-time recovery, and file group backups allow backing up individual files or groups.
Using sql server 2008's merge statement tech republicKaing Menglieng
The document discusses SQL Server 2008's new MERGE statement, which allows inserting, updating, or deleting data in one table based on conditions in another table in a single statement. It provides an example using the MERGE statement to load sales data from a staging table into a reporting table, handling inserting new records as well as updating existing records with new sales amounts and counts. The MERGE statement combines the logic of separate insert, update, and delete statements into one statement for efficiently modifying data between tables.
More Related Content
Similar to Sql server – query optimization – remove bookmark lookup – remove rid lookup
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction Mark Ginnebaugh
Patrick Sheehan of Microsoft covers platform architecture, data warehousing methodology, and multi-dimensional cube development.
You will learn:
* How to develop and deploy data cubes using SQL Server Analysis Services (SSAS)
* Optimal data warehouse methodology for use with SSAS
* Tips/tricks for designing & building cubes over no warehouse/suboptimal source system (it happens)
* Cube processing types - How/why to use each
* Cube design practices + How to build and deploy cubes!
This document summarizes new features in SQL Server 2016 for SQL Server Integration Services (SSIS), Master Data Services (MDS), Data Quality Services (DQS), Analysis Services (SSAS), and Reporting Services (SSRS). For SSIS, new features include auto-adjusting buffer size, an Azure feature pack, and incremental package deployment. For MDS, improvements include longer attribute names, composite indexes, and entity synchronization. For SSAS, enhancements focus on performance, consistency, and new DAX functions. For SSRS, additions center around treemap/sunburst charts, custom parameters, and HTML5 rendering.
SQL Server Workshop for Developers - Visual Studio Live! NY 2012Andrew Brust
Here are the key enhancements to the OVER clause in SQL Server 2012:
- Ability to specify both PARTITION BY and ORDER BY clauses, allowing window functions to operate over ordered partitions of data. This enables more advanced windowing scenarios.
- New window frame specifications - RANGE and ROWS, which allow window functions to consider rows before and/or after the current row within the partition. This enables window functions like moving averages.
- Ability to use window functions with aggregate functions like SUM(), COUNT(), etc. This allows calculations like cumulative sums within partitions.
- Performance improvements for window functions through optimizations like push-down of predicates and better parallelization.
So in summary, SQL Server 2012 significantly expands the
Why you should be mining your data and how to actually do it. Every company needs a rock star. We want it to be you. This session will give real world examples of data mining successes as well as walk you through how to get started down the path of data enlightenment, so that you too can say "I Am A Data Miner℠".
Database administrators are responsible for maintaining high performance of databases like Oracle, SQL Server, and Red Hat that support enterprise applications like Blackboard. Quest Software's Spotlight tool helps administrators monitor and diagnose performance issues across various database platforms in real-time and historically. It provides visualizations of process flows, metrics, and alerts to identify bottlenecks and root causes of poor performance. Spotlight supports various database environments including Oracle, Oracle RAC, and SQL Server databases.
Nivedita Alure seeks a position as a SQL DBA with over 1.6 years of experience in SQL Server administration and MSBI development. She has expertise in SQL Server installation, configuration, backup/recovery, security, and performance tuning. She is proficient in T-SQL, SSIS, SSRS, and has experience developing ETL processes and reports. Her educational qualifications include a BE in Telecommunication and she has strong technical, analytical, and problem-solving skills.
Migrating on premises workload to azure sql databasePARIKSHIT SAVJANI
This document provides an overview of migrating databases from on-premises SQL Server to Azure SQL Database Managed Instance. It discusses why companies are moving to the cloud, challenges with migration, and the tools and services available to help with assessment and migration including Data Migration Service. Key steps in the migration workflow include assessing the database and application, addressing compatibility issues, and deploying the converted schema to Managed Instance which provides high compatibility with on-premises SQL Server in a fully managed platform as a service model.
Amit Sharma is a database administrator with over 7 years of experience managing MySQL databases. He has expertise in areas like database replication, performance tuning, backup/recovery, and Linux administration. Currently working as a database administrator at GetIt Stores, his previous roles include database administrator and junior software engineer positions. He holds a B.Tech in Computer Science and seeks to utilize his skills and experience in database management.
Getahun Gebremariam is seeking a position as a SQL Server DBA and has over 3 years of experience providing 24/7 support on production and non-production environments. He has expertise in SQL Server 2005/2008/2012/2014, Windows Server 2008/2012, and ETL tools like SSIS, SSAS, and SSRS. His responsibilities have included database administration tasks like performance monitoring and optimization, high availability configuration, backup and restore, and index management. He is proficient in T-SQL, database maintenance and has experience migrating data between SQL Server and Oracle databases.
Trivadis TechEvent 2017 Oracle to My SQL Migration - Challenges by Robert Bia...Trivadis
Migration from one database engine to another one for existing applications is not a trivial task. There are a lot of technical challenges, including but not limited to database features, object/data types and different behavior. In this presentation we would like to talk about a customer PoC, with the goal to migrate as many databases from Oracle to MySQL as possible. This includes categorization of several hundred Oracle databases into migration classes, based on custom criteria, as well as tool development to support schema (DDL) conversion and data migration.
This document contains the resume of Hemanth Kumar, who is a SQL Server DBA with over 4 years of experience working as a DBA for various companies including Unisys India Pvt Ltd and IMS Health. He has skills in installing, configuring, monitoring and troubleshooting Microsoft SQL Server. Some of his responsibilities as a DBA include managing backups, monitoring disk space, security management, performance optimization through index creation, and implementing high availability options such as log shipping and database mirroring. He is looking for a challenging SQL Server role to utilize his technical expertise.
This document provides an overview of an online training program for Oracle SQL. It covers topics like database basics, how databases work, what SQL is and why it is needed. The training will provide hands-on lab exercises and real-time guidance from instructors. It aims to help students learn SQL skills and prepare for placements in database jobs.
SQL SERVER|MASTERS offers SQL Server DBA training in Chennai taught by experienced experts. The training covers topics like the history of SQL Server, installation, configuration, security management, backup and recovery, database replication, job scheduling, performance monitoring, and performance tuning. Attendees will learn from a famous DBA specialist who has solved problems for many companies. For more details on the training, contact +91-9052666559 or visit www.sqlservermasters.com.
Geek Sync | Locating and Resolving Common Database Performance Issues in Micr...IDERA Software
You can watch the replay for this Geek Sync webcast in the IDERA Resource Center: http://ow.ly/8wTs50A5bgc
No database professional can afford to avoid performance issues, no matter how big or small. What best practices are you following?
Join IDERA and Devin Gallagher on Thursday, November 2 at 4 PM CT as he walks through locating and resolving common database performance issues. Devin will explore hot objects, poor performing SQL, missing or bad indexes and more. Catch an inside look into DB Optimizer with a technical specialist and learn how it successfully automates SQL tuning and profiling, and locates and resolves many of your common and not-so-common performance issues. Devin will also look at some performance drill down areas within Aqua Data Studio.
Attending PASS Summit? This will be a special live Geek Sync you will not want to miss in Booth 112.
Ponmagal N is a Database Administrator with over 2 years of experience in SQL Server database administration, development, and maintenance. She has extensive experience with SQL Server 2008/2012, T-SQL, SSIS, and SSRS. Some of her responsibilities include database design, query and stored procedure development, performance tuning, backup and recovery procedures, and report development. She has worked on projects involving a time tracking application, a mobile app, and providing database support for an insurance company. Ponmagal holds a PG Diploma in VLSI and Embedded Hardware Design and a Bachelor's Degree in Electrical and Electronics Engineering.
PL SQLDay Machine Learning- Hands on ML.NET.pptxLuis Beltran
The document provides an overview of a presentation on machine learning with ML.NET. It discusses machine learning concepts and workflows, how to use ML.NET to build models with .NET, and integrating ML.NET with other Microsoft technologies like Azure ML and TensorFlow. The agenda includes machine learning, ML.NET, the ML workflow, data preparation, model training, evaluation and deployment, and deep learning.
NoSQL Database: Classification, Characteristics and ComparisonMayuree Srikulwong
My students' presentation of a paper "NoSQL Database: New Era of Databases for Big Data Analytics - Classification, Characteristics and Comparison" by Moniruzzaman, A.B.M. and Hossain, S.A. (2013).
Lakshmi Srinivas Pallapothu is a software engineer with 3 years of experience in SQL Server development, BI tools like SSIS, SSRS and SSAS, and .NET technologies. He has expertise in ETL development, data warehousing, report generation and web application development. Currently he works as a software engineer at OSI Technologies handling projects for clients like NCH Marketing Services and Prologic Redemption Solutions.
The document discusses obtaining a connection to a database in Java using JDBC. It provides code examples of creating a database connection using the DriverManager class and Oracle's JDBC Thin driver. The code inserts a record into an EMP table for demonstration purposes. Best practices for database connectivity in a Java project are then covered, such as using the DAO pattern to separate data access logic from business logic. This improves testability, reusability and flexibility in switching database types.
This document provides information about an upcoming SQL Saturday Night event on March 30, 2013 that will focus on using T-SQL. The presentation will be recorded so that those unable to attend can view it later. Attendees are asked to change their virtual cards to a specific color if they are unable to hear the presenter. The presentation will be free and begin in 1 minute.
Similar to Sql server – query optimization – remove bookmark lookup – remove rid lookup (20)
What is your sql server backup strategy tech_republicKaing Menglieng
The document discusses various SQL Server backup strategies including full backups, differential backups, transaction log backups, and file group backups. It explains how to implement each strategy using either SQL Server Enterprise Manager graphical user interface or Transact SQL commands. Full backups create a complete picture of the database, differential backups back up only changed data since the last full backup, transaction log backups back up transactions and allow point-in-time recovery, and file group backups allow backing up individual files or groups.
Using sql server 2008's merge statement tech republicKaing Menglieng
The document discusses SQL Server 2008's new MERGE statement, which allows inserting, updating, or deleting data in one table based on conditions in another table in a single statement. It provides an example using the MERGE statement to load sales data from a staging table into a reporting table, handling inserting new records as well as updating existing records with new sales amounts and counts. The MERGE statement combines the logic of separate insert, update, and delete statements into one statement for efficiently modifying data between tables.
Using object dependencies in sql server 2008 tech republicKaing Menglieng
This document discusses how SQL Server 2008 improves on tracking object dependencies by name rather than ID. It introduces two new dynamic management functions and a view for tracking dependencies. An example creates database objects with dependencies and queries the new functions and view to identify referenced and referencing objects. The conclusion states advantages of tracking dependencies by name include finding objects referencing those that don't exist.
Using hash fields in sql server tech republicKaing Menglieng
The document discusses using hash fields in SQL Server. It explains that hash fields can be used for auditing data changes and capturing data for data warehouses. It shows how to create a hash field using the BINARY_CHECKSUM function on multiple fields. This creates a hash value that changes when the fields change, allowing detection of data modifications. It demonstrates adding a hash field to a sample SalesHistory table and discusses how hash fields can simplify change data capture for data warehousing.
Using grouping sets in sql server 2008 tech republicKaing Menglieng
This article discusses the new GROUPING SETS clause in SQL Server 2008, which allows specifying combinations of field groupings in queries to see different levels of aggregated data. It provides an example showing how GROUPING SETS can return aggregated data at both the product level and grand total level. Another example shows returning aggregates by product, sales tier, and grand total. The article notes this functionality enhances reporting by returning multiple aggregations in one statement rather than separate queries.
Understand when to use user defined functions in sql server tech-republicKaing Menglieng
User-defined functions (UDFs) in SQL Server allow users to define custom functions that can accept parameters and return values. There are two main types of UDFs - table-valued functions that return results in a table that can be queried, and scalar-valued functions that return a single value. The document provides examples of creating both types of UDFs and using them to return sales data from a sample SalesHistory table based on input parameters.
Sql server indexed views speed up your select queries part 1 - code-projecKaing Menglieng
This document discusses indexed views in SQL Server, which allow for optimizing select queries. Indexed views store clustered index data to provide another location for the query optimizer to find data. They are best suited for read-heavy databases like data warehouses. The document covers how to create indexed views, including using schema binding and unique clustered indexes, and constraints like deterministic queries. It provides an example of creating a view and index on a table to optimize queries against that data.
Sql server common interview questions and answersKaing Menglieng
The document discusses common interview questions and answers related to SQL Server. It provides 6 questions and answers about topics like the TCP/IP port SQL Server uses, the differences between clustered and non-clustered indexes, index configurations for tables, collation sensitivity types, what OLTP is, and the differences between primary and unique keys.
Sql server common interview questions and answers page 6Kaing Menglieng
This document discusses common SQL Server interview questions and answers. It defines BCP as a tool used to copy large amounts of data between tables or views without copying structures. It also describes how to implement one-to-one, one-to-many, and many-to-many relationships in table design. Finally, it explains that an execution plan shows the query optimization methods chosen by SQL Server and can be viewed within Query Analyzer to understand query performance.
Sql server common interview questions and answers page 5Kaing Menglieng
This document contains 30 common interview questions and answers about SQL Server. Some of the questions covered include: what is a NOT NULL constraint, how to get @@ERROR and @@ROWCOUNT at the same time, what are the advantages of using stored procedures, what is a table called if it has neither a cluster nor non-cluster index, and if SQL Server can be linked to other servers like Oracle.
Sql server common interview questions and answers page 4Kaing Menglieng
This document discusses differences between local and global temporary tables in SQL Server. A local temporary table exists only for the duration of a connection, while a global temporary table remains in the database permanently but the rows only exist within a given connection. It also explains the STUFF and REPLACE functions, where STUFF overwrites existing characters at a given start position and length, while REPLACE replaces all occurrences of a search string. Primary keys, unique keys, foreign keys and check constraints are also summarized. Primary keys uniquely identify rows, unique keys enforce uniqueness of column values, foreign keys prevent orphaned rows, and check constraints limit column values.
Sql server common interview questions and answers page 2Kaing Menglieng
The document discusses differences between the DELETE and TRUNCATE commands in SQL Server. DELETE removes rows one by one and can be rolled back, while TRUNCATE removes all rows faster but cannot be rolled back. It also discusses the use of UPDATE_STATISTICS to update indexes after large data changes, and the differences between the HAVING and WHERE clauses. Finally, it defines SQL Profiler as a tool to monitor SQL Server events and lists the two authentication modes in SQL Server (Windows and Mixed) that can be changed in the SQL Server Configuration Manager.
Sql server – 2008 – hardware and software requirements for installing sql seKaing Menglieng
The document provides the minimum hardware and software requirements for installing SQL Server 2008. It lists requirements such as the .NET Framework 3.5, Windows Installer 4.5, Internet Explorer 6 SP1, and various supported Windows operating systems. It also provides specific requirements for installing different editions of SQL Server 2008 such as the Enterprise edition requiring a minimum 1 GHz processor and 512 MB of RAM.
Speeding up queries with semi joins and anti-joinsKaing Menglieng
- Semi-joins return rows from the first table where matches are found in the second table, but return each matching row from the first table only once. Anti-joins return rows from the first table where no matches are found in the second table.
- Semi-joins can be written using EXISTS or IN clauses, while anti-joins use NOT EXISTS or NOT IN. This allows Oracle to use more efficient semi-join and anti-join access paths.
- Oracle has improved at optimizing queries with EXISTS and IN clauses over time, and in Oracle 9i and later the choice is usually not important as Oracle will generate efficient plans for both.
The document provides tips for speeding up SQL queries and database performance, including avoiding SELECT *, using indexes appropriately, normalizing tables, parameterizing queries, and optimizing stored procedures. Specific suggestions include explicitly selecting columns, using memory tables for frequently accessed lookup tables, and increasing query timeouts for long running reports.
Speed up sql server apps - visual studio magazineKaing Menglieng
This article provides 10 tips for improving the performance of SQL Server applications. Some of the tips include using EXISTS instead of COUNT(*) when checking for existence, being careful when using WHERE IN and WHERE NOT IN clauses, randomizing result sets with NEWID(), and increasing the default packet size for transferring large data fields.
See sql server graphical execution plans in action tech republicKaing Menglieng
Tim Chapman identifies a few basic things to look for in SQL Server graphical execution plans to understand how indexes are used. He creates a sample database with different indexes and queries it in various ways to demonstrate index seeks, scans, and lookups. The article shows how indexes can improve query performance when columns have high selectivity but may not help when columns have few distinct values.
Reviewing sql server permissions tech republicKaing Menglieng
The document reviews SQL Server permissions. It discusses reviewing login information using the sys.server_principals view, determining database users using sys.database_principals, viewing roles assignments with other system views, and identifying object permissions with sys.database_permissions. Examples are provided to test adding a login, user, and role membership. The document aims to help administrators understand permissions on their SQL Server instance.
Query optimization how to search millions of record in sql table faster -Kaing Menglieng
The document is a question posted on Stack Overflow asking how to search millions of records in a SQL table faster. The question details searching a table with 50 million records and 5 columns to find records containing "lifeis". Indexing did not help speed up the LIKE query. Respondents recommend using a full-text index, which supports faster LIKE queries for patterns beginning with a fixed string. While an index on the searched column could provide some help, a full-text index is likely the best approach given the large number of records.
Optimize sql server queries with these advanced tuning techniques tech repuKaing Menglieng
The document discusses several advanced techniques for optimizing SQL Server queries:
1. Using JOIN statements instead of subqueries to improve performance.
2. Using explicit transactions around data manipulation statements to reduce writes to the transaction log.
3. Using UNION ALL instead of UNION to avoid removing duplicate records.
4. Using EXISTS instead of COUNT(*) when checking for conditions to return results faster.
5. Using STATISTICS IO to determine the number of logical reads of a query to optimize performance.
1. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
Home All Articles SQL Interview Q & A Blog Stats Contact Tools SQL Books >>Search<<
SQL S ERVER J OURNEY WITH SQL Feeds: Posts Comments
A UTHORITY
Personal Notes of Pinal Dave
« SQL SERVER – Interesting Observation SQL SERVER – Query Optimization – COMMUNITY INITIATIVES
– Query Hint – FORCE ORDER Remove Bookmark Lookup – Remove RID
Lookup – Remove Key Lookup – Part 2 »
SQL SERVER – Query Optimization – Remove Bookmark
Lookup – Remove RID Lookup – Remove Key Lookup
October 7, 2009 by pinaldave
Today, I would like to share one very quick tip about how to remove bookmark
lookup or RID lookup. Let us first understand Bookmark lookup or RID lookup.
Please note that from SQL Server 2005 SP1 onwards, Bookmark look up is known
as Key look up.
When a small number of rows are requested by a query, the SQL Server optimizer
will try to use a non-clustered index on the column or columns contained in the
WHERE clause to retrieve the data requested by the query. If the query requests
data from columns not present in the non-clustered index, SQL Server must go
back to the data pages to get the data in those columns. Even if the table has a
clustered index or not, the query will still have to return to the table or clustered
index to retrieve the data.
In the above scenario, if table has clustered index, it is called bookmark lookup
(or key lookup); if the table does not have clustered index, but a non-clustered
index, it is called RID lookup. This operation is very expensive. To optimize any
query containing bookmark lookup or RID lookup, it should be removed from the
execution plan to improve performance. There are two different ways to remove
bookmark/RID lookup.
Before we understand these two methods, we will create sample table without
clustered index and simulate RID lookup. RID Lookup is a bookmark lookup on a
heap that uses a supplied row identifier (RID).
USE tempdb
GO
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
2. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
-- Create Table OneIndex with few columns
CREATE TABLE OneIndex (ID INT,
FirstName VARCHAR(100),
LastName VARCHAR(100),
City VARCHAR(100))
GO
-- Insert One Hundred Thousand Records
INSERT INTO OneIndex (ID,FirstName,LastName,City)
SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY a.name) RowID,
'Bob',
CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%2 = 1 THEN 'Smith'
ELSE 'Brown' END,
CASE
WHEN ROW_NUMBER() OVER (ORDER BY a.name)%1000 = 1 THEN 'Las Vegas'
WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 1 THEN 'New York'
WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 5 THEN 'San Marino'
WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 3 THEN 'Los Angeles'
ELSE 'Houston' END
ABOUT PINAL DAVE
FROM sys.all_objects a
Pinal Dave is a Technology
CROSS JOIN sys.all_objects b Evangelist. He has written over
GO 2200 articles on the subject on
his blog at
Now let us run following select statement and check the execution plan. http://blog.sqlauthority.com.
SELECT ID, FirstName Along with 8+ years of hands
on experience he holds a
FROM OneIndex
Masters of Science degree and
WHERE City = 'Las Vegas' a number of certifications,
GO including MCTS, MCDBA and
MCAD (.NET). He is co-author
of three SQL Server books -
SQL Server Programming, SQL
Wait Stats and SQL Server
Interview Questions and
Answers. His past work
experiences includes
Technology Evangelist at
Microsoft and Sr. Consultant at
SolidQ. Prior to joining
Microsoft he was awarded
Microsoft MVP award for three
continuous years for his
contribution in community.
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
3. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
As there is no index on table, scan is performed over the table. We will create a
clustered index on the table and check the execution plan once again.
-- Create Clustered Index
CREATE CLUSTERED INDEX [IX_OneIndex_ID] ON [dbo].[OneIndex]
(
[ID] ASC
) ON [PRIMARY]
Follow @pinaldave
GO Send +Pinal Dave an email at
pinal@sqlauthority.com
Now, run following select on the table once again.
SELECT ID, FirstName
FROM OneIndex BLOG STATS
WHERE City = 'Las Vegas' 47,000,371 (46 Million+)
GO
EMAIL SUBSCRIPTION
Enter your email address to
subscribe to this blog and
receive notifications of new
posts by email.
Join 32,364 other followers
Sign me up!
SQL IN SIXTY SECONDS
<!--[if gte mso 9]> 800x600 <![endif]-->
<!--[if gte mso 9]> Normal 0 false false false EN-US X-NONE X-NONE
MicrosoftInternetExplorer4 <![endif]--><!--[if gte mso 9]> <![endif]-->
It is clear from execution plan that as a clustered index is created on the table,
table scan is now converted to clustered index scan. In either case, base table is
completely scanned and there is no seek on the table. BOOKS I AUTHORED
Now, let us see the WHERE clause of our table. From our basic observation, if we
create an index on the column that contains the clause, a performance
improvement may be obtained. Let us create non-clustered index on the table and
then check the execution plan.
-- Create Index on Column City As that is used in where condition
CREATE NONCLUSTERED INDEX [IX_OneIndex_City] ON [dbo].[OneIndex]
(
[City] ASC
) ON [PRIMARY]
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
4. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
GO
After creating the non-clustered index, let us run our select statement again and
check the execution plan. .
Amazon | Kindle
SELECT ID, FirstName
Flipkart | Indiaplaza
FROM OneIndex
WHERE City = 'Las Vegas'
GO
.
Amazon | Kindle
Flipkart | Indiaplaza
<!--[if gte mso 9]> 800x600 <![endif]-->
As we have an index on the WHERE clause, the SQL Server query execution
engine uses the non-clustered index to retrieve data from the table. However, the
columns used in the SELECT clause are still not part of the index, and to display
those columns, the engine will have to go to the base table again and retrieve
those columns. This particular behavior is known as bookmark lookup or key Amazon | Kindle
lookup. Flipkart | Indiaplaza
There are two different methods to resolve this issue. I have demonstrated both
the methods together; however, it is recommended that you use any one of these
methods for removing key lookup. I prefer Method 2.
Method 1: Creating non-clustered cover index.
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
5. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
In this method, we will create non-clustered index containing the columns, which
are used in the SELECT statement, along with the column which is used in the
Amazon | 1 | 2 | 3 | 4 | 5
WHERE clause.
Flipkart | Indiaplaza
CREATE NONCLUSTERED INDEX [IX_OneIndex_Cover] ON [dbo].[OneIndex]
(
City, FirstName, ID FUNNY INDEX VIDEO
) ON [PRIMARY]
GO
Once the above non-clustered index, which covers all the columns in query, is
created, let us run the following SELECT statement and check our execution plan.
SELECT ID, FirstName
FROM OneIndex
WHERE City = 'Las Vegas'
GO
From the execution plan, we can confirm that key lookup is removed the only Login
index seek is happening. As there is no key lookup, the SQL Server query engine
does not have to go to retrieve the data from data pages and it obtains all the
necessary data from index itself. SQLAuthori
on Facebook
Like
Con
21,525 people
like
SQLAuthority.co
21,524 people
like
SQLAuthority.co
.
Method 2: Creating an included column non-clustered index. Naresh
Facebook social plugin
Here, we will create non-clustered index that also includes the columns, which are
used in the SELECT statement, along with the column used in the WHERE clause.
In this method, we will use new syntax introduced in SQL Server 2005. An index
with included nonkey columns can significantly improve query performance when SQLAUTHORITY LINKS
Subscribe to Newsletter
all columns in the query are included in the index.
My Homepage
CREATE NONCLUSTERED INDEX [IX_OneIndex_Include] ON [dbo].[OneIndex] Windows Live Blog
( --------------------
City Top Downloads
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
6. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
) INCLUDE (FirstName,ID) ON [PRIMARY] PDF Downloads
GO Script Downloads
From the execution plan, it is very clear that this method also removes the key Script Bank
lookup as well. Favorite Scripts
All Scripts - 1
All Scripts - 2
All Scripts - 3
Top Articles
Best Articles
Favorite Articles - 1
Favorite Articles - 2
--------------------
> SQL Interview Q & A <
SQL Coding Standards
SQL FAQ Download
--------------------
Jobs @ SQLAuthority
In summary, Key lookup, Bookmark lookup or RID lookup reduces the
performance of query, and we can improve the performance of query by using
included column index or cover index.
ABOUT NUPUR DAVE
I will cover few additional concepts related to the optimal method in another Nupur Dave loves technology
article. simply because it makes life
more convenient. She is
Reference : Pinal Dave (http://blog.sqlauthority.com)
devoted to technology because
Related Post: it touches our heart makes our
daily lives easier. Among the
SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID
many technological programs
Lookup – Remove Key Lookup she uses and embraces
SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Windows Live most because
she can do lots of things with
Lookup – Remove Key Lookup – Part 2
ease – from photo management
SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID to movies; business emails to
Lookup – Remove Key Lookup – Part 3 personal social media
connections.
DISCLAIMER
This is a personal weblog. The
opinions expressed here
represent my own and not
those of my employer. For
accuracy and official reference
refer to MSDN/ TechNet/ BOL.
My employer do not endorse
any tools, applications, books,
or concepts mentioned on the
blog. I have documented my
personal experience on this
blog.
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
7. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
Share:
TOP 3 COMMENTERS
2397 - Madhivanan
Like this: �Like Be the first to like this.
474 - Imran Mohammed
Posted in Pinal Dave, SQL, SQL Authority, SQL Index, SQL Optimization, SQL Performance, 301 - Ramdas Jaya
SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology
| 28 Comments
28 Responses
Brad Schulz on October 7, 2009 at 11:13 am | Reply
No need to add ID to your nonclustered index… that’s redundant. Since
you have a clustered index on ID, then ID will automatically be included
in any nonclustered index you create (so that it could do the bookmark
lookup).
So your nonclustered index examples would be to either create an index on (City,
FirstName) or an index on (City) INCLUDE (FirstName).
–Brad
Pradip on October 7, 2009 at 11:29 am | Reply
I have a table customer in which cstid of BIGINT data type with identity.
As table have identity column I do not want any type of index on it. Being
cstid as primary key of table, is it possible without any index?
Michael on October 7, 2009 at 12:23 pm | Reply
Dear Pinal,
good post, very clear sample, but I would like to see a remark, that Key-
Lookups could be in some situations, special with very wide tables, and the SELECT
includes a lot or all of the columns, the much much better way. Think about a
table containing 11.000.000 customers with 200 columns an the avg size of a row
of 30kb. The SELECT need to return the whole row-data. Seach is done within the
lastname, no leading placeholder to be able to use an Index. So an additional
small index only containing the lastname and the key and then doing an Key
Lookup is much much faster instead of using the index, even clustered index
where every row nees severals data blocks. In case of IO we see differences in the
factor of 500 times more IO.
Regards,
Michael
DBTEAM on November 17, 2009 at 7:21 pm | Reply
Hi pinal,
We have a requirement to Merge six 12millions data tables into single
Table.All the tables are having duplicate Emails.So We put the Primary key for
email column using EnterPrise Manager and We r trying to merge by writing
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
8. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
the following insert query, But it’s taking more than 20hrs…:-(
Insert into Total(
Email,FirstName,LastName,Address,City,State,Zipcode,Gender,DOB ,
Phone,WebAddress1,Webaddress2,IPAddress,DateTime,Interest )
Select Email,FirstName,LastName,Address,City,State,Zipcode,Gender,DOB ,
Phone,WebAddress1,Webaddress2,IPAddress,DateTime,Interest
From [Set4]
Where
(not exists(select email from Total
where Total.email=[Set4].email))
How can we do this most efficiently??? Please Help Us……
Thanks in advance…
pinaldave on October 7, 2009 at 1:03 pm | Reply
Brad Schulz,
You are correct, however, I am going to cover that particular concept in
different blog post.
This post is written to show the concept of covering Index. In next blog post, I am
going to show as there is clustered index, your non clustered index will not require
that key and it can be still covering Index.
Kind Regards,
Pinal
stanly on October 21, 2011 at 2:24 pm | Reply
how can i remove duplicate records in a table and after deleting
duplicate records i need one distinct record
madhivanan on October 24, 2011 at 9:22 pm | Reply
Search for “delete duplicate values” in this site. You will get
related articles
Ramdas on October 7, 2009 at 7:37 pm | Reply
Hi Pinal,
Nice explanation of the covering index concept. What is your take on the
comment posted by Michael about the customer table situation, where
one needs to return a lot of columns.
Thank you
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
9. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
dave p on October 7, 2009 at 9:04 pm | Reply
Pinal,
Why not just remove, from the query, the column that’s causing the key
lookup. This is really much simpler I’m sure you’ll agree. You’ve written about best
practices for database design in the past, and taught me that fewer columns per
table are always better. So if you’re getting lots of key lookups, it follows that we
should split up our tables and make them smaller. This is the query optimizer’s
way of telling us that we have messed up our design!
Thank you for continuing to educate us on how best to use our database.
pinaldave on October 7, 2009 at 10:33 pm | Reply
Hi,
We can not remove the columns which are needed in query from SELECT
statement.
That would not be best practices.
dave p on October 7, 2009 at 11:58 pm | Reply
But what if you don’t need those columns. Then you can remove them.
This example proves that you shouldn’t add columns to a query that you
don’t need. That’s never a best practice (at least in my experience). You
revealed in another post that we should keep indexes as narrow as possible, and I
have been following this rule religiously! Since starting down this path I have
managed to get almost every index in our database down to a single column. So
far this has worked very nicely as far as I can tell, but I’m not really sure how to
collect query performance numbers. Would you mind helping me so that I can
send you a report and you can show readers what great progress can be made if
we follow your methods.
pinaldave on October 8, 2009 at 6:28 am | Reply
Hi,
If we do not need those columns in query for SURE they need to be
removed. I agree with you there.
I will send you other details soon.
Kind Regards,
Pinal
SQL SERVER – Query Optimization – on October 8, 2009 at 7:01 am | Reply
Remove Bookmark Lookup – Remove RID Lookup – Remove Key
Lookup – Part 2 Journey to SQL Authority with Pinal Dave
[...] 8, 2009 by pinaldave This article is follow up of my previous article
SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
10. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
Lookup ̵…. Please do read my previous article before continuing [...]
SQL SERVER – Query Optimization – on October 12, 2009 at 7:01 am | Reply
Remove Bookmark Lookup – Remove RID Lookup – Remove Key
Lookup – Part 3 Journey to SQL Authority with Pinal Dave
[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup –
Remove RID Lookup – Remove Key Lo… [...]
jfbergeron on October 13, 2009 at 4:41 pm | Reply
Hi Pinal,
I’m curious to know why you have included the ID column in the covering
index, as well as in the nc index with the includes. I thought all columns in the
Clustered index were already included in the non clustered index.
Is there a reason why you did that?
Thanks,
pinaldave on October 13, 2009 at 5:28 pm | Reply
Hi jfbergeron,
Please read my follow up post here :
SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID
Lookup – Remove Key Lookup – Part 3
http://blog.sqlauthority.com/2009/10/12/sql-server-query-optimization-remove-
bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-3
Kind Regards,
Pinal
Barbara37 on October 23, 2009 at 4:24 pm | Reply
And these new notes were not just plain bank notes. ,
SQL SERVER – Removing Key Lookup – on November 9, 2009 at 7:01 am | Reply
Seek Predicate – Predicate – An Interesting Observation Related
to Datatypes Journey to SQL Authority with Pinal Dave
[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup –
Remove RID Lookup – Remove Key Lo… [...]
SQL SERVER – Remove Bookmark Key on November 22, 2009 at 7:02 am | Reply
Lookup – 4 Different Ideas Journey to SQL Authority with Pinal
Dave
[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup –
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
11. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
Remove RID Lookup – Remove Key Lo… [...]
Mike Chapman on November 24, 2009 at 1:19 am | Reply
Awesome. Managed to knock down a query from 5-6 minutes down to 5
seconds or so.
Ronald Lee on January 10, 2010 at 12:40 pm | Reply
Excellent Post!!! Thank you for the information. This helps me improve my
SP from 5 seconds to 0.xx second. Thanks alot!
SQL SERVER – Four Posts on Removing the on May 13, 2010 at 7:01 am | Reply
Bookmark Lookup – Key Lookup Journey to SQL Authority with
Pinal Dave
[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup –
Remove RID Lookup – Remove Key Lo… [...]
Sridhar Nalluri on June 15, 2010 at 2:13 pm | Reply
Hi Pinal,
Nice post, very impressive and understandable…Thank You.
Nick Duckstein on November 2, 2010 at 5:23 am | Reply
Dave,
I’m confused why the best recommendation isn’t to create a clustered
index. In our situation we have a 5 Billion row table without a clustered index. The
RID lookups are killing us. The need for a lot of extra non-clustered indexes is
also killing performance because this is on a replication server.
Finally the writes to a clustered index are dramatically less than to a non-
clustered index with a HEAP.
See: http://msdn.microsoft.com/en-us/library/cc917672.aspx#EFAA
How can anyone justify a large table without a clustered index?
Nick
Nidhi on March 28, 2011 at 8:36 pm | Reply
HI Pinal,
Thanks for this post.Its very easy to understand.Good post.
SQL SERVER – Interview Questions and on July 19, 2011 at 7:00 am | Reply
Answers – Frequently Asked Questions – Day 19 of 31 Journey to
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
12. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
SQLAuthority
[...] In the above scenario, if table has clustered index, it is called
bookmark lookup (or key lookup); if the table does not have clustered index, but a
non-clustered index, it is called RID lookup. (Read more here) [...]
SQL SERVER – An Important Part of Most on January 5, 2012 at 7:02 am | Reply
SELECT statement – WHERE clause – Quiz – Puzzle – 4 of 31 «
SQL Server Journey with SQL Authority
[...] Questions and Answers ISBN: 1466405643 Page#38-40 Does Order
of Column in WHERE clause Matter? Query Optimization – Remove Bookmark
Lookup – Remove RID Lookup – Remove Key Lookup Logical Query Processing
Phases – Order of Statement [...]
Hemant K on January 9, 2012 at 11:31 am | Reply
Hi,
If you are saying, if table has clustered index, it is called bookmark
lookup (or key lookup); if the table does not have clustered index, but a
non-clustered index, it is called RID lookup then you again wrote that as we have
an index on the WHERE clause, the SQL Server query execution engine uses the
non-clustered index to retrieve data from the table. However, the columns used in
the SELECT clause (id, firstname) are still not part of the index that means
(neither cluster index nor non-cluster index has applied on it)and to display those
columns, the engine will have to go to the base table again and retrieve those
columns. so how we can say this particular behavior is known as bookmark lookup
or key lookup
Comments RSS
Leave a Reply
Email (required) (Address never made public)
Name (required)
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]
13. SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup « SQL Server Journey with SQL Author...
Website
Notify me of follow-up comments via email. Post Comment
Notify me of new posts via email.
Blog at WordPress.com. Theme: Customized MistyLook by WPThemes.
http://blog.sqlauthority.com/...ql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup/[08/29/2012 5:01:34 PM]