1 / 10

ICS 421 Spring 2010 Performance Tuning

ICS 421 Spring 2010 Performance Tuning. Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa. Performance Tuning. Given a database Tables (schema etc) Data a workload Queries and their frequency Updates and their frequency

minty
Download Presentation

ICS 421 Spring 2010 Performance Tuning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ICS 421 Spring 2010Performance Tuning Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa Lipyeow Lim -- University of Hawaii at Manoa

  2. Performance Tuning Given • a database • Tables (schema etc) • Data • a workload • Queries and their frequency • Updates and their frequency • DBMS software running on some hardware What knobs can you play with to improve performance ? Lipyeow Lim -- University of Hawaii at Manoa

  3. Knobs & Factors Knobs • Indexes • Query rewriting • Table schema • Locking • Logging • Hardware • Memory Factors • Data Size • Budget • Purpose • Workload • Read intensive vs write intensive • Types of queries • Frequencies Lipyeow Lim -- University of Hawaii at Manoa

  4. Query 100: Brute Force Cone Search dec SELECTO.objID, O.ra, O.dec, O.htmid, O.zoneid FROMObject O WHERE( SIN(RADIANS(O.dec)) * SIN(RADIANS( +0.5)) + COS(RADIANS(O.dec)) * COS(RADIANS( +0.5)) * COS(RADIANS((O.ra) - (67.5))) ) >= COS(RADIANS( 1.0/60.0)) ra x • (67.5,0.5) • y Lipyeow Lim -- University of Hawaii at Manoa

  5. Query 101: Prefiltering using ZoneID dec SELECT O.objID, O.ra, O.dec, O.htmid, O.zoneid FROMObject O WHERE (zoneidBETWEEN FLOOR((90.0 + 0.5 - ( 1.0/60.0))/0.008333) AND FLOOR((90.0 + 0.5 + (1.0/60.0))/0.008333)) AND ( SIN(RADIANS(O.dec)) * SIN(RADIANS( +0.5)) + COS(RADIANS(O.dec)) * COS(RADIANS( +0.5)) * COS(RADIANS((O.ra) - (67.5))) ) >= COS(RADIANS( 1.0/60.0)) ra Lipyeow Lim -- University of Hawaii at Manoa

  6. Query 103: Prefiltering using a Pyramid dec SELECTO.objID, O.ra, O.dec, O.htmid, O.zoneid FROMObject O WHERE (O.raBETWEEN ((67.5)-( 1.0/60.0)) AND ((67.5)+( 1.0/60.0))) AND (O.dec BETWEEN (( +0.5)-( 1.0/60.0)) AND (( +0.5)+( 1.0/60.0))) AND ( SIN(RADIANS(O.dec)) * SIN(RADIANS( +0.5)) + COS(RADIANS(O.dec))* COS(RADIANS( +0.5)) * COS(RADIANS((O.ra) - (67.5))) ) >= COS(RADIANS( 1.0/60.0)) ra x • (67.5,0.5) • y Lipyeow Lim -- University of Hawaii at Manoa

  7. Query 110: Join with Detection SELECT O.objID, O.ra, O.dec, O.htmid, O.zoneid, D.detectid FROMObject O, Detection D WHEREO.objid=D.objid AND ( SIN(RADIANS(O.dec)) * SIN(RADIANS( +0.5)) + COS(RADIANS(O.dec)) * COS(RADIANS( +0.5)) * COS(RADIANS((O.ra) - (67.5))) ) >= COS(RADIANS( 1.0/60.0)) Lipyeow Lim -- University of Hawaii at Manoa

  8. Schema for Object & Detection • CREATE TABLE Detection ( • objID BIGINT, • detectID BIGINT, • filterID SMALLINT, • imageID BIGINT, • obsTime FLOAT, • raObs FLOAT, • decObs FLOAT, • mag REAL, • sky REAL, • sgSep REAL ) ; CREATE TABLE Object ( objID BIGINT, htmID BIGINT, zoneID INT, ra DOUBLE, dec DOUBLE, cx DOUBLE, cy DOUBLE, cz DOUBLE, lambda FLOAT, beta FLOAT, l FLOAT, b FLOAT, lsgFLOAT, bsgFLOAT, gMagBestREAL, rMagBest REAL, iMagBest REAL, zMagBest REAL, yMagBest REAL, grColor REAL, riColor REAL, izColor REAL, zyColor REAL, sgSep REAL ) Lipyeow Lim -- University of Hawaii at Manoa

  9. Horizontal Decomposition CREATE TABLE DETECTION201001(....) CREATE TABLE DETECTION201002(....) CREATE TABLE DETECTION201003(....) ALTER TABLEDETECT201001 ADD CONSTRAINT CHK_JAN CHECK(MONTH(obsTime) =1); ... INSERT INTO ... ... CREATE VIEW DETECTION AS SELECT * FROM DETECTION201001 UNION ALL SELECT * FROM DETECTION201002 UNION ALL SELECT* FROMDETECTION201003 Lipyeow Lim -- University of Hawaii at Manoa

  10. Performance Tuning Tools • Explain • Not getting the right plans ? runstats • Twisting the arm of the optimizer using selectivity clause • Event Monitors • Other smart tools • Index advisors • Schema advisors • Query patroller Lipyeow Lim -- University of Hawaii at Manoa

More Related