Concept explainers
This assignment is aimed at building an understanding of how to improve performance within databases by taking advantage the computers hardware by modifying MS SQL settings
Prerequisites:
Completion of Assignment 1B, reading of Module Readings and Slides.
Run the following query to understand how much Memory is currently in use in the
SELECT
physical_memory_in_use_kb/1024 AS sql_physical_memory_in_use_MB,
large_page_allocations_kb/1024 AS sql_large_page_allocations_MB,
locked_page_allocations_kb/1024 AS sql_locked_page_allocations_MB,
virtual_address_space_reserved_kb/1024 AS sql_VAS_reserved_MB,
virtual_address_space_committed_kb/1024 AS sql_VAS_committed_MB,
virtual_address_space_available_kb/1024 AS sql_VAS_available_MB,
page_fault_count AS sql_page_fault_count,
memory_utilization_percentage AS sql_memory_utilization_percentage,
process_physical_memory_low AS sql_process_physical_memory_low,
process_virtual_memory_low AS sql_process_virtual_memory_low
FROM sys.dm_os_process_memory;
Instructions:
Part A: Query Baseline
Execute the following query, and record the runtime. It can be seen on the bottom of the screen next to the number of rows.
- Select * From Student Join Enrollment on Student.ID = Enrollment.Student_ID Order by Name_Last desc
Total execution time:00:00:14.924
Part B: Upping the RAM
- Run the follow query to increase the set the RAM available to the database to something higher than what you saw in the sql_physical_memory_in_use_MB column on the query above. You’ll need to see how much Memory your particular device has to set this correctly, but the below example will show an increase to 8GB
- sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max server memory', 8192;
GO
RECONFIGURE;
GO
;
- Note the above query is 8GB. If you want to go to 4 GB, divide that number by 2, or 16 GB multiply by 2, but it is dependent on your PCs available memory
- You must Restart your PC for this to take effect
Part C: Re-Run Query Baseline in Part A
- Re-Run the Query from Part A and evaluate if the speed to execute it increased or decreased
Submission:
In 200-400 words, evaluate whether decreasing/increasing the Memory provided detriments/benefits in query performance, why it made that impact/did not make that impact, and determine which of the two readings you’d recommend to users to base their tuning on.
reading:https://www.sqlservertutorial.net/sql-server-basics/sql-server-primary-key/
https://www.sqlshack.com/dont-fear-sql-server-performance-tuning/
The question at hand is the essential topic of optimizing MS SQL Server for maximum database performance. It investigates the effects of altering SQL Server memory settings and attempts to establish if decreasing or increasing memory allocation enhances or degrades query performance. The analysis seeks to offer insight on why these changes have the effects that they do and, finally, proposes which strategy users should prioritize for their tuning efforts. This is an important concern for SQL Server database administrators and developers, as performance optimization can have a substantial impact on the efficiency and responsiveness of database-driven applications.
Step by stepSolved in 4 steps
- SQL Query questionarrow_forwardRefer to the film and inventory tables of the Sakila database. The tables in this lab have the same columns and data types but fewer rows. Write a query that lists the titles of films with the fewest rows in the inventory table. This query requires a subquery that computes the minimum of counts by film_id: SELECT MIN(count_film_id) FROM ( SELECT COUNT(film_id) AS count_film_id FROM inventory GROUP BY film_id ) AS temp_table; This subquery is provided in the template.arrow_forwardDatabase systems In SQL MurachCollege database. Provide a list of all of the students, the number of courses they are taking, and the number of different instructors they have across all of their courses. The first column should provide the last name of each student (column titled Student Last Name). The second column should provide the number of courses that each student is taking (column titled Number of Courses). The third column should provide the number of different instructors that each student has for all of the courses they are taking (column titled Number of Different Instructors). No other columns should be provided in the result. Organize the result by student last name in alphabetical order.arrow_forward
- Please help with the following: Using oracle sql live or sql developer what sql statements could be use to find the following: A simple database composed of the following tables: PATIENT, DOCTOR, DRUG, and PRESCRIPTION. Please explore the database and then write the appropriate SQL command. List doctor’s details where speciality is either Dermatology or Neurology. (Use INoperator). List the results by the first name in ascending order and the last name indescending order. Find all patients rows whose first names include ‘George’ (Assume case sensitivity). sql doc below Beginfor c in (select table_name from user_tables) loopexecute immediate ('drop table '||c.table_name||' cascade constraints');end loop;End;//* */ ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';CREATE TABLE DOCTOR (DOC_ID varchar2(5) PRIMARY KEY,DOC_LNAME varchar2(15),DOC_FNAME varchar2(15),DOC_INITIAL varchar2(1),DOC_SPECIALTY varchar2(15));INSERT INTO DOCTOR…arrow_forwardlease help with the below regarding VBA and Access SQLarrow_forwardTask 2: The Driver Relationship team wants to arrange workshops and education materials to the drivers. However, the team wants to create clusters of the drivers based on their experience in InstantStay. To collect these detail, you will need to create a SQL function called DRIVER_STATUS to determine the level of the driver as follows: MASTER: more than 4 travels PRO: more than 2 travels ROOKIE: 2 or less travels In addition, run the function to verify it works as expected and send them back the driver levels. Task: Create the DRIVER_STATUS function to create clusters of drivers based on experience.arrow_forward
- Use your ERD to define the table structures in the database using SQL DDL commands to build your schema.arrow_forwardI need help with this question for my Database Management class for SQL developer. Thank you REP (REP_NUM, LAST_NAME, FIRST_NAME, STREET, CITY, STATE, POSTAL_CODE, COMISSION, RATE) CUSTOMER (CUSTOMER_NUM, CUSTOMER_NAME, STREET, CITY, STATE, POSTAL_CODE, BALANCE, CREDIT_LIMIT, REP_NUM) ORDERS (ORDER_NUM, ORDER_DATE, CUSTOMER_NUM) ORDER_LINE (ORDER_NUM, ITEM_NUM, NUM_ORDERED, QUOTED_PRICE) ITEM (ITEM_NUM, DESCRIPTION, ON_HAND, CATEGORY, STOREHOUSE, PRICE) Question: List TOY category items and orders placed for them. Report: Item_Num, Description, Order_Num, and Order_Datearrow_forwardin sql You define a PRIMARY KEY constraint on the EMP_ID column for a table named EMPLOYEES that you created Which actions occur automatically? Select one: a. A CHECK constraint is defined on the EMP_ID column. b.A unique index is created on the EMP_ID column, if one does not already exist c.A trigger is created that will prevent NULL values from being accepted in the EMP_ID column. d. A sequence is created that will generate a unique value in the EMP_ID column for each row that is inserted into the CUSTOMERS table.arrow_forward
- Assistance with SQL statements Previous code; CREATE TABLE Lab4program_piershed ( code VARCHAR(5) PRIMARY KEY, name VARCHAR(20), tel VARCHAR(20));CREATE TABLE Lab4course_xxxx ( cid INT PRIMARY KEY, name VARCHAR(20), credits INT, mycode VARCHAR(5), FOREIGN KEY (mycode) REFERENCES Lab4program_xxxx(code)); 1. Insert 3 records into your Lab4program_xxxx table. The code should be "CPS", "TECH", "MATH", or "BIO". Please copy/paste your SQL statements with the output message in the text that shows you successfully insert 3 records to your table. 2. Insert 4 records into your Lab4course_xxxx table with at least 2 different mycode. Please copy/paste your SQL statements with the output message in the text that shows you successfully insert 4 records to your table.arrow_forwarde a SQL query to display the customer ID, name, and order ID for all customer orders. For those customers who do not have any orders, include them in the display once.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education