Presentation is loading. Please wait.

Presentation is loading. Please wait.

Blue Collar SQL Tricks - Make Standard Edition Work for you.

Similar presentations


Presentation on theme: "Blue Collar SQL Tricks - Make Standard Edition Work for you."— Presentation transcript:

1 Blue Collar SQL Tricks - Make Standard Edition Work for you.
~ Wolf ~ This template can be used as a starter file for presenting training materials in a group setting. Sections Right-click on a slide to add sections. Sections can help to organize your slides or facilitate collaboration between multiple authors. Notes Use the Notes section for delivery notes or to provide additional details for the audience. View these notes in Presentation View during your presentation. Keep in mind the font size (important for accessibility, visibility, videotaping, and online production) Coordinated colors Pay particular attention to the graphs, charts, and text boxes. Consider that attendees will print in black and white or grayscale. Run a test print to make sure your colors work when printed in pure black and white and grayscale. Graphics, tables, and graphs Keep it simple: If possible, use consistent, non-distracting styles and colors. Label all graphs and tables.

2 Resources to use: #sqlsatBham #sqlhelp #sqlserver
Add slides to each topic section as necessary, including slides with tables, graphs, and images. See next section for sample table, graph, image, and video layouts. #sqlsatBham #sqlhelp #sqlserver

3 About Wolf DBA for 17 years
At RDX for over 6 years. “Manager – SQL Server Performance Tuning” Works with a variety of clients and challenges Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.

4

5

6 What We Will Focus On 1 2 3 Back to Basics Buffer Pool Extension
Partitioned Views 3 Filtered Statistics/Indexes 4 This is another option for an Overview slide.

7 Configuration Basics Min/Max Memory Tempdb Sizing/Configuration
For <= 8 cores, Tempdb data files = # of cores For > 8 cores, 8 Tempdb data files Hyper-Threading Logical hyper-thread CPUs appear as physical CPUs to the operating system Instant File Initialization Faster data growth by NOT zeroing out the file

8 Normalization First Normal Form (1NF)
No repeating groups of information(nothing “;” or “,” delimited) Second Normal Form (2NF) The truth, the whole truth and nothing but the truth Third Normal Form (3NF) Remove groups not dependent on the primary key Boyce-Codd Normal Form(BCNF) A 3NF table that does not have multiple overlapping candidate keys is guaranteed to be in BCNF

9 Buffer Pool Extension What is the buffer pool?
SQL Server is a memory hog When a query is run the pages are loaded in memory, all subsequent calls which need this page would be read from Buffer Pool – this would avoid disk IO and hence improve performance. Data cache scanned periodically. If there is memory pressure, if the page was not accessed on the last two scans, the pages is removed from memory In SQL Server 2014/2016 Standard, the maximum memory usage is 128GB In SQL Server 2008R2 and 2012 it is 64GB Buffer Pool Extensions provide a way of expanding a server’s buffer pool capacity by taking advantage of flash storage While the performance won’t comparable to straight memory, it will out perform standard disk reads. The size of the buffer pool extension can be up to 4 times the max_server_memory value for Standard edition

10 BPE Disabled Spinning Disk Min 2GB Max 5GB

11 BPE Disabled Spinning Disk Min 500MB Max 750MB

12 BPE Enabled Spinning Disk Min 500MB Max 750MB

13 BPE Disabled on SSD Min 2GB Max 5GB

14 Partitioned Views A form of poor man’s partitioning
Partitioned views allow the data in a large table to be split into smaller member tables. The data is partitioned between the member tables based on ranges of data values in one of the columns. Each table must have a check constraint on the range value column The view is created with “UNION ALL” between the tables Query optimizer uses the CHECK constraint definitions to determine which member table contains the rows View is updateable as long as the partitioning column is part of the primary key To perform updates on a partitioned view, the partitioning column must be a part of the primary key of the base table. If a view is not updatable, you can create an INSTEAD OF trigger on the view that allows updates. You should design error handling into the trigger to make sure that no duplicate rows are inserted. For an example of an INSTEAD OF trigger designed on a view, see Designing INSTEAD OF Triggers. CHECK constraints are not needed for the partitioned view to return the correct results. However, if the CHECK constraints have not been defined, the query optimizer must search all the tables instead of only those that cover the search condition on the partitioning column. Without the CHECK constraints, the view operates like any other view with UNION ALL. The query optimizer cannot make any assumptions about the values stored in different tables and it cannot skip searching the tables that participate in the view definition.

15 Filtered Statistics Another form of poor man’s partitioning
“Where Clause” on the statistics creation Can have up to 30,000 statistics on non-indexed columns Can fix cardinality estimate errors Great for finding out lying values

16 Filtered Indexes Another form of poor man’s partitioning
“Where clause” on the index creation Filtered indexes are great performance boosts if you have a value that is used in a predicate very frequently, but that value is only a small amount of the total values for that table Use equality or inequality operators. Use IN to create an index for a range of values. Multiple filtered indexes on one column There are MANY restrictions

17 Well Now

18 Resources

19 Microsoft Engineering Excellence
Questions? Microsoft Confidential


Download ppt "Blue Collar SQL Tricks - Make Standard Edition Work for you."

Similar presentations


Ads by Google