Safe Harbor Statement

Size: px
Start display at page:

Download "Safe Harbor Statement"

Transcription

1

2 Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 2

3 MySQL Optimizer: What s New in 8.0 Øystein Grøvlen Senior Principal Software Engineer MySQL Optimizer Team, Oracle May, 2018

4 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 4

5 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 5

6 Common Table Expression Alternative to derived table A derived table is a subquery in the FROM clause SELECT FROM (subquery) AS derived, t1... Common Table Expression (CTE) is just like a derived table, but its declaration is put before the query block instead of in FROM clause WITH derived AS (subquery) SELECT FROM derived, t1... A CTE may precede SELECT/UPDATE/DELETE including sub-queries WITH derived AS (subquery) DELETE FROM t1 WHERE t1.a IN (SELECT b FROM derived); 6

7 Common Table Expression vs Derived Table Better readability Can be referenced multiple times Can refer to other CTEs Improved performance 7

8 Better Readability Derived table: CTE: SELECT FROM t1 LEFT JOIN ((SELECT FROM ) AS dt JOIN t2 ON ) ON WITH dt AS (SELECT... FROM...) SELECT... FROM t1 LEFT JOIN (dt JOIN t2 ON...) ON... 8

9 Can Be Referenced Multiple Times Derived table can not be referenced twice: CTE can: SELECT... FROM (SELECT a, b, SUM(c) s FROM t1 GROUP BY a, b) AS d1 JOIN (SELECT a, b, SUM(c) s FROM t1 GROUP BY a, b) AS d2 ON d1.b = d2.a; WITH d AS (SELECT a, b, SUM(c) s FROM t1 GROUP BY a, b) SELECT... FROM d AS d1 JOIN d AS d2 ON d1.b = d2.a; Better performance with materialization: Multiple references only materialized once Derived tables and views will be materialized once per reference. 9

10 Can Refer to Other CTEs Derived tables can not refer to other derived tables: SELECT FROM (SELECT FROM ) AS d1, (SELECT FROM d1 ) AS d2 ERROR: 1146 (42S02): Table db.d1 doesn t exist CTEs can refer other CTEs: WITH d1 AS (SELECT FROM ), d2 AS (SELECT FROM d1 ) SELECT FROM d1, d2 10

11 Recursive CTE WITH RECURSIVE cte AS ( SELECT... FROM table_name /* "seed" SELECT */ UNION [DISTINCT ALL] SELECT... FROM cte, table_name ) /* "recursive" SELECT */ SELECT... FROM cte; A recursive CTE refers to itself in a subquery The seed SELECT is executed once to create the initial data subset, the recursive SELECT is repeatedly executed to return subsets of. Recursion stops when an iteration does not generate any new rows To limit recursion, set cte_max_recursion_depth Useful to dig in hierarchies (parent/child, part/subpart) 11

12 Recursive CTE A simple example Print 1 to 10 : WITH RECURSIVE qn AS ( SELECT 1 AS a UNION ALL SELECT 1+a FROM qn WHERE a<10 ) SELECT * FROM qn; a

13 Hierarchy Traversal Employee database CREATE TABLE employees ( id INT PRIMARY KEY, name VARCHAR(100), manager_id INT, FOREIGN KEY (manager_id) REFERENCES employees(id) ); INSERT INTO employees VALUES (333, "Yasmina", NULL), # CEO (198, "John", 333), # John reports to 333 (692, "Tarek", 333), (29, "Pedro", 198), (4610, "Sarah", 29), (72, "Pierre", 29), (123, "Adil", 692); 13

14 Hierarchy Traversal List reporting chain WITH RECURSIVE emp_ext (id, name, path) AS ( SELECT id, name, CAST(id AS CHAR(200)) FROM employees WHERE manager_id IS NULL UNION ALL SELECT s.id, s.name, CONCAT(m.path, ",", s.id) FROM emp_ext m JOIN employees s ON m.id=s.manager_id ) SELECT * FROM emp_ext ORDER BY path; id name path 333 Yasmina John 333, Tarek 333, Pedro 333,198, Adil 333,692, Sarah 333,198,29, Pierre 333,198,29,72 14

15 Hierarchy Traversal List reporting chain WITH RECURSIVE emp_ext (id, name, path) AS ( SELECT id, name, CAST(id AS CHAR(200)) FROM employees WHERE manager_id IS NULL UNION ALL SELECT s.id, s.name, CONCAT(m.path, ",", s.id) FROM emp_ext m JOIN employees s ON m.id=s.manager_id ) SELECT * FROM emp_ext ORDER BY path; id name path 333 Yasmina John 333, Pedro 333,198, Sarah 333,198,29, Pierre 333,198,29, Tarek 333, Adil 333,692,123 15

16 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 16

17 Window Functions: What Are They? A window function performs a calculation across a set of rows that are related to the current row, similar to an aggregate function. But unlike aggregate functions, a window function does not cause rows to become grouped into a single output row. Window functions can access values of other rows in the vicinity of the current row Aggregate function Window function 17

18 Window Function Example Sum up total salary for each department: SELECT name, dept_id, salary, SUM(salary) OVER (PARTITION BY dept_id) AS dept_total FROM employee ORDER BY dept_id, name; The OVER keyword signals a window function PARTITION == disjoint set of rows in result set name dept_id salary dept_total Newt NULL Dag 10 NULL Ed Fred Jon Michael Newt Lebedev Pete Jeff Will

19 Window Function Example: Frames name dept_id salary total Newt NULL Dag 10 NULL NULL Ed Fred Jon Michael Newt Lebedev Pete Jeff Will SELECT name, dept_id, salary, SUM(salary) OVER (PARTITION BY dept_id ORDER BY name ROWS 2 PRECEDING) total FROM employee ORDER BY dept_id, name; moving window frame: SUM(salary)... ROWS 2 PRECEDING A frame is a subset of a partition ORDER BY name within each partition 19

20 Window Function Example: Frames name dept_id salary total Newt NULL Dag 10 NULL NULL Ed Fred Jon Michael Newt Lebedev Pete Jeff Will SELECT name, dept_id, salary, SUM(salary) OVER (PARTITION BY dept_id ORDER BY name ROWS 2 PRECEDING) total FROM employee ORDER BY dept_id, name; 20

21 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 21

22 Improved UTF-8 Support in MySQL 8.0 Support for the latest Unicode 9.0 utf8mb4 made default character set! utf8mb4_0900_ai_ci default collation Accent and case sensitive collations Including 20+ language specific collations Now also Japanese and Russian Significantly improved performance 22

23 What Is in MySQL 5.7 and Earlier Versions? Default charset is latin1 and default collation is latin1_swedish_ci utf8 = utf8mb3: support BMP only utf8mb4 character set: Only accent and case insensitive collations Default collation is utf8mb4_general_ci, compares all characters beyond BMP, e.g. emojis, to be equal 20+ language specific collations Recommend to use: utf8mb4_unicode_520_ci 23

24 New Default Character Set No changes to existing tables Only has effect on new tables/schemas where character set is not explicitly defined. Separating character set/collation change from server upgrade Upgrade first, change charset/collation afterwards Recommend users to not mixing collations Error Illegal mix of collations Slower query because index can no longer be used 24

25 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 25

26 GIS Geography Support longitude/latitude Spatial Reference Systems (SRS) Support 5000 SRIDs from EPSG Geodetic Parameter Dataset SRID 4326 = WGS 84 ( GPS coordinates ) INFORMATION_SCHEMA.ST_SPATIAL_REFERENCE_SYSTEM SRID aware spatial datatypes, indexes, and functions Information Schema views ST_GEOMETRY_COLUMNS GeoHash(), GeoJSON() 26

27 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 27

28 SELECT... FOR UPDATE SKIP LOCKED Common problem: Hot row contention, multiple worker threads accessing the same rows Solution 1: Only read rows that are not locked InnoDB skips a locked row, and the next one goes to the result set Example: Booking system: Skip orders that are pending START TRANSACTION; SELECT * FROM seats WHERE seat_no BETWEEN 2 AND 3 AND booked = 'NO' FOR UPDATE SKIP LOCKED; 28

29 SELECT FOR UPDATE NOWAIT Common problem: Hot row contention, multiple worker threads accessing the same rows Solution 2: If any of the rows are already locked, the statement should fail immediately Without NOWAIT, have to wait for innodb_lock_wait_timeout (default: 50 sec) while trying to acquire lock Usage: START TRANSACTION; SELECT * FROM seats WHERE seat_no BETWEEN 2 AND 3 AND booked = 'NO' FOR UPDATE NOWAIT; ERROR 3572 (HY000): Statement aborted because lock(s) could not be acquired 29

30 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 30

31 JSON Functions MySQL 5.7 and 8.0 JSON_ARRAY_APPEND() JSON_ARRAY_INSERT() JSON_ARRAY() JSON_CONTAINS_PATH() JSON_CONTAINS() JSON_DEPTH() JSON_EXTRACT() JSON_INSERT() JSON_KEYS() JSON_LENGTH() JSON_MERGE[_PRESERVE]() JSON_OBJECT() JSON_QUOTE() JSON_REMOVE() JSON_REPLACE() JSON_SEARCH() JSON_SET() JSON_TYPE() JSON_UNQUOTE() JSON_VALID() JSON_PRETTY() JSON_STORAGE_SIZE() JSON_STORAGE_FREE() JSON_ARRAYAGG() JSON_OBJECTAGG() JSON_MERGE_PATCH() JSON_TABLE() 31

32 JSON Data Type CREATE TABLE t1(json_col JSON); INSERT INTO t1 VALUES ( '{ "people": [ { "name":"john Smith", "address":"780 Mission St, San Francisco, CA 94103"}, { "name":"sally Brown", "address":"75 37th Ave S, St Cloud, MN 94103"}, { "name":"john Johnson", "address":"1262 Roosevelt Trail, Raymond, ME 04071"} ); ] }' 32

33 JSON_TABLE Convert JSON documents to relational tables SELECT people.* FROM t1, JSON_TABLE(json_col, '$.people[*]' COLUMNS ( name VARCHAR(40) PATH '$.name', address VARCHAR(100) PATH '$.address')) people; name address John Smith 780 Mission St, San Francisco, CA Sally Brown 75 37th Ave S, St Cloud, MN 9410 John Johnson 1262 Roosevelt Trail, Raymond, ME

34 JSON_TABLE Filter JSON data SELECT people.* FROM t1, JSON_TABLE(json_col, '$.people[*]' COLUMNS ( name VARCHAR(40) PATH '$.name', address VARCHAR(100) PATH '$.address')) people; WHERE people.name LIKE 'John%'; name address John Smith 780 Mission St, San Francisco, CA John Johnson 1262 Roosevelt Trail, Raymond, ME

35 JSON_TABLE Nested Arrays [ ] { "father":"john", "mother":"mary", "marriage_date":" ", "children": [ { "name":"eric", "age":12 }, { "name":"beth", "age":10 } ] }, { "father":"paul", "mother":"laura", "children": [ { "name":"sarah", "age":9}, { "name":"noah", "age":3}, { "name":"peter", "age":1} ] } id father married child_id child age 1 John 1 1 Eric 12 1 John 1 2 Beth 10 2 Paul 0 1 Sarah 9 2 Paul 0 2 Noah 3 2 Paul 0 3 Peter 1 35

36 JSON_TABLE Nested Arrays JSON_TABLE (families, '$[*]' COLUMNS ( id FOR ORDINALITY, father VARCHAR(30) PATH '$.father', married INTEGER EXISTS PATH '$.marriage_date', NESTED PATH '$.children[*]' COLUMNS ( child_id FOR ORDINALITY, child VARCHAR(30) PATH '$.name', age INTEGER PATH '$.age ) ) id father married child_id child age 1 John 1 1 Eric 12 1 John 1 2 Beth 10 2 Paul 0 1 Sarah 9 2 Paul 0 2 Noah 3 2 Paul 0 3 Peter 1 36

37 JSON_TABLE SQL aggregation on JSON data SELECT father, COUNT(*) "#children", AVG(age) "age average" FROM t, JSON_TABLE (families, '$[*]' COLUMNS ( id FOR ORDINALITY, father VARCHAR(30) PATH '$.father', NESTED PATH '$.children[*]' COLUMNS (age INTEGER PATH '$.age ) ) AS fam GROUP BY id, father; father #children age average John Paul

38 JSON Aggregation Combine JSON documents in multiple rows into a JSON array CREATE TABLE t1 (id INT, grp INT, jsoncol JSON); INSERT INTO t1 VALUES (1, 1, '{"key1":"value1","key2":"value2"}'); INSERT INTO t1 VALUES (2, 1, '{"keya":"valuea","keyb":"valueb"}'); SELECT JSON_ARRAYAGG(jsoncol) FROM t1; [{"key1":"value1","key2":"value2"}, {"keya":"valuea","keyb":"valueb"}, {"keyx":"valuex","keyy":"valuey"}] INSERT INTO t1 VALUES (3, 2, '{"keyx":"valuex","keyy":"valuey"}'); 38

39 JSON Aggregation Put IDs into objects SELECT JSON_ARRAYAGG(JSON_MERGE_PATCH(JSON_OBJECT("id", id), family)) AS families FROM t, JSON_TABLE (families, '$[*]' COLUMNS ( id FOR ORDINALITY, family JSON PATH '$')) fam; families [{"id": 1, "father": "John", "mother": "Mary", "children": [{"age": 12, "name": "Eric"}, {"age": 10, "name": "Beth"}], "marriage_date": " "}, {"id": 2, "father": "Paul", "mother": "Laura", "children": [{"age": 9, "name": "Sarah"}, {"age": 3, "name": "Noah"}, {"age": 1, "name": "Peter"}]}] 39

40 JSON Aggregation Combine JSON documents in multiple rows into a JSON object CREATE TABLE t1 (id INT, grp INT, jsoncol JSON); INSERT INTO t1 VALUES (1, 1, '{"key1":"value1","key2":"value2"}'); INSERT INTO t1 VALUES (2, 1, '{"keya":"valuea","keyb":"valueb"}'); SELECT grp, JSON_OBJECTAGG(id, jsoncol) FROM t1 GROUP BY grp; 1 {"1":{"key1":"value1","key2":"value2"}, "2":{"keyA":"valueA","keyB":"valueB"}} 2 {"3":{"keyX":"valueX","keyY":"valueY"}} INSERT INTO t1 VALUES (3, 2, '{"keyx":"valuex","keyy":"valuey"}'); 40

41 JSON Utility Functions JSON_PRETTY(json_value) Pretty-print the JSON value JSON_STORAGE_SIZE(json_value) The number of bytes used to store the binary representation of a JSON document JSON_STORAGE_FREE(json_value) The number of bytes in its binary representation that is currently not used. The binary representation may have unused space after a JSON column was updated in-place using JSON_SET() 41

42 Partial Update of JSON In 5.7: Updating a JSON document always causes the entire document to be written In 8.0: Automatically detect potential in-place updates JSON_SET, JSON_REPLACE, JSON_REMOVE Input and target columns are the same Updating existing values, not adding new ones New value is equal to or smaller than the original value, or previous partial update has left sufficient space In 8.0: Only diff is shipped through binlog (default full image) In 8.0: InnoDB supports partial update of BLOB 42

43 Indexing JSON Array Upcoming! 5.7: Single value index, one index record <-> one data record Multi-value index for efficient queries against array fields Use CAST( <expr> AS <type> ARRAY) to create multi-valued index Expr is any expression that returns JSON array Type is any SQL type supported by CAST() 43

44 Indexing JSON Array id Families 1 {"father":"john", "mother":"mary", "marriage_date":" ", "children": [ {"name":"eric","age":12,"eyes":"blue"}, {"name":"beth","age":10, "eyes": "green"}]} 2 {"father":"paul", "mother": "Laura", "children": [ {"name":"sarah","age":9,"eyes":"brown"}, {"name":"noah","age":3,"eyes": "green"}, {"name":"peter","age":1,"eyes": "green"}]} Upcoming! CREATE TABLE t (families JSON); ALTER TABLE t ADD INDEX eye_color ((CAST(families->>"$.children[*].eyes" AS CHAR(10) ARRAY))) eye_color id blue 1 brown 2 green 1 green 2 44

45 Indexing JSON Array Upcoming! Find parents with children having brown eyes: SELECT id, families->>"$.father", families->>"$.mother" FROM t WHERE "brown" IN (families->>"$.children[*].eyes"); id father mother 2 Paul Laura eye_color id blue 1 brown 2 green 1 green 2 45

46 Indexing JSON Array Upcoming! Find parents with children having either blue or brown eyes. SELECT id, families->>"$.father", families->>"$.mother" FROM t WHERE JSON_OVERLAPS(families->>"$.children[*].eyes", '["blue", "brown"]') id father mother 1 John Mary 2 Paul Laura eye_color id blue 1 brown 2 green 1 green 2 46

47 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 47

48 Invisible Index Index is maintained by the SE, but ignored by the Optimizer Primary key cannot be INVISIBLE Use case: Check for performance drop BEFORE dropping an index ALTER TABLE t1 ALTER INDEX idx INVISIBLE; mysql> SHOW INDEXES FROM t1; Table Key_name Column_name Visible t1 idx a NO To see an invisible index: set optimizer_switch='use_invisible_indexes=on'; 48

49 Descending Index CREATE TABLE t1 ( a INT, b INT, INDEX a_b (a DESC, b ASC) ); In 5.7: Index in ascending order is created, server scans it backwards In 8.0: Index in descending order is created, server scans it forwards Works on B-tree indexes only Benefits: Use indexes instead of filesort for ORDER BY clause with ASC/DESC sort key Forward index scan is slightly faster than backward index scan 49

50 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 50

51 Motivation for Improving the MySQL Cost Model Produce more correct cost estimates Better decisions by the optimizer should improve performance Adapt to new hardware architectures SSD, larger memories, caches More maintainable cost model implementation Avoid hard coded cost constants Refactoring of existing cost model code Configurable and tunable Faster queries Make more of the optimizer cost-based 51

52 New Storage Technologies Time to do a table scan of 10 million records: Memory SSD Hard disk 5 s s s Adjust cost model to support different storage technologies Provide configurable cost constants for different storage technologies Provide a program that could measure performance and suggest good cost constant configuration for a running MySQL server? 52

53 Memory Buffer Aware Cost Estimates Storage engines: Estimate for how much of data and indexes are in a memory buffer Estimate for hit rate for memory buffer Optimizer cost model: Take into account whether data is already in memory or need to be read from disk Server Database buffer Query executor Disk data Storage engine 53

54 Histograms Column statistics Provides the optimizer with information about column value distribution To create/recalculate histogram for a column: ANALYZE TABLE table UPDATE HISTOGRAM ON column WITH n BUCKETS; May use sampling Sample size is based on available memory (histogram_generation_max_mem_size) Automatically chooses between two histogram types: Singleton: One value per bucket Equi-height: Multiple value per bucket 58

55 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 62

56 Hints: Join Order Hints to control table order for join execution 5.7: STRAIGHT_JOIN to force the listed order in FROM clause 8.0: JOIN_FIXED_ORDER /* replacement for STRAIGHT_JOIN*/ JOIN_ORDER /* use specified order */ JOIN_PREFIX /* use specified order for first tables */ JOIN_SUFFIX /* use specified order for last tables */ No need to reorganize the FROM clause to add join order hints like you will for STRAIGHT_JOIN 63

57 Hints: Index Merge Index merge: Merge rows from multiple range scans on a single table Algorithms: union, intersection, sort union Users can specify which indexes to use for index merge /*+ INDEX_MERGE() */ /*+ NO_INDEX_MERGE() */ INDEX(a) SELECT * FROM t1 WHERE a=10 AND b=10 10 INDEX(b) 10 Intersection Result: a=10 AND b=10 65

58 Index Merge Hint - Example EXPLAIN SELECT count(*) FROM users WHERE user_type=2 AND status=0 AND parent_id=0; id select type table type possible keys key key len ref rows Extra Low selectivity 1 SIMPLE users index_ merge parent_id, status, user_type user_type, status, parent_id 1,1,4 NULL 2511 Using intersect (user_type, status, parent_id); Using where; Using index mysql> SELECT count(*) FROM users WHERE user_type=2 AND status=0 AND parent_id=0;... 1 row in set (1.37 sec) mysql> SELECT /*+ INDEX_MERGE(users user_type, status) */ count(*) -> FROM users WHERE user_type=2 AND status=0 AND parent_id=0;... 1 row in set (0.18 sec) 66

59 Hints: Set session variables Set a session variable for the duration of a single statement Examples: SELECT /*+ SET_VAR(sort_buffer_size = 16M) */ name FROM people ORDER BY name; INSERT /*+ SET_VAR(foreign_key_checks = OFF) */ INTO t2 VALUES (1, 1), (2, 2), (3, 3); SELECT /*+ SET_VAR(optimizer_switch = 'condition_fanout_filter = off') */ * FROM customer JOIN orders ON c_custkey = o_custkey WHERE c_acctbal < 0 AND o_orderdate < ' '; NB! Not all session variables are settable through hints: mysql> SELECT /*+ SET_VAR(max_allowed_packet=128M) */ * FROM t1; Empty set, 1 warning (0,01 sec) Warning (Code 4537): Variable 'max_allowed_packet' cannot be set using SET_VAR hint. 67

60 Program Agenda Common table expressions Window functions UTF8 support GIS SKIP LOCKED, NOWAIT JSON functions Index extensions Cost model Hints Better IPv6 and UUID support 68

61 Improved Support for UUID mysql> select uuid(); uuid() aab5d5fd-70c1-11e5-a4fb-b026b977eb Five - separated hexadecimal numbers MySQL uses version 1, the first three numbers are generated from the low, middle, and high parts of a timestamp. 36 characters, inefficient for storage Convert to BINARY(16) datatype, only 16 bytes 69

62 Improved Support for UUID Functions to convert UUID to and from binary UUID_TO_BIN(string_uuid, swap_flag) BIN_TO_UUID(binary_uuid, swap_flag) IS_UUID(string_uuid) Feature Request from Developers 70

63 UUID_TO_BIN Optimization Binary format is now smaller Shuffling low part with the high part improves index performance From VARCHAR(36) To BINARY(16) 53303f87-78fe-11e6-a477-8c89a52c4f3b 11e678fe53303f87a4778c89a52c4f3b Insert Performance Optimized Original 71

64 IPv6 New! Bit-wise operations on binary data types Designed with IPv6 in mind: INET6_ATON(address) & INET6_ATON(network) No longer truncation beyond 64 bits Feature Request from Developers 72

65 All These Features and More Improved Query Scan Performance GROUPING() Hint: Merge/materialize derived table/view JSON: Improved performance of sorting and grouping of JSON values Path expressions: Array index ranges JSON_MERGE_PATCH() Unicode support for reg. exp. Skip index dives for FORCE INDEX Parser Refactoring Try it out! Give us feedback! 73

66 Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 74

67 75

68

Combining SQL and NoSQL with MySQL

Combining SQL and NoSQL with MySQL Combining SQL and NoSQL with MySQL Manyi Lu Director MySQL Optimizer Team, Oracle April, 2018 Copyright 2016, 2014, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The following

More information

What Is New in Optmizer and Executor?

What Is New in Optmizer and Executor? MySQL 8.0: What Is New in Optmizer and Executor? Norvald H. Ryeng Sofware Development Senior Manager MySQL Optmizer Team October, 2018 Safe Harbor Statement The following is intended to outline our general

More information

More SQL in MySQL 8.0

More SQL in MySQL 8.0 More SQL in MySQL 8.0 Norvald H. Ryeng Sofware Development Senior Manager MySQL Optmizer Team November, 08 Program Agenda 3 4 Common table expressions (CTEs) Window functons JSON_TABLE Demo 5 6 7 3 Theory

More information

MySQL 8.0 What s New in the Optimizer

MySQL 8.0 What s New in the Optimizer MySQL 8.0 What s New in the Optimizer Manyi Lu Director MySQL Optimizer & GIS Team, Oracle October 2016 Copyright Copyright 2 015, 2016,Oracle Oracle and/or and/or its its affiliates. affiliates. All All

More information

NoSQL + SQL = MySQL. Nicolas De Rico Principal Solutions Architect

NoSQL + SQL = MySQL. Nicolas De Rico Principal Solutions Architect NoSQL + SQL = MySQL Nicolas De Rico Principal Solutions Architect nicolas.de.rico@oracle.com Safe Harbor Statement The following is intended to outline our general product direction. It is intended for

More information

#MySQL #oow16. MySQL Server 8.0. Geir Høydalsvik

#MySQL #oow16. MySQL Server 8.0. Geir Høydalsvik #MySQL #oow16 MySQL Server 8.0 Geir Høydalsvik Copyright Copyright 2 2016, 016,Oracle Oracle aand/or nd/or its its aaffiliates. ffiliates. AAll ll rights rights reserved. reserved. Safe Harbor Statement

More information

MySQL JSON. Morgan Tocker MySQL Product Manager. Copyright 2015 Oracle and/or its affiliates. All rights reserved.

MySQL JSON. Morgan Tocker MySQL Product Manager. Copyright 2015 Oracle and/or its affiliates. All rights reserved. MySQL 5.7 + JSON Morgan Tocker MySQL Product Manager Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not

More information

MySQL 8.0: Common Table Expressions

MySQL 8.0: Common Table Expressions MySQL 8.0: Common Table Expressions Guilhem Bichot Lead Software Engineer MySQL Optimizer Team, Oracle Who With MySQL AB / Sun / Oracle since 2002 Coder on the Server from 4.0 to 8.0 Replication, on-line

More information

Modern Development With MySQL

Modern Development With MySQL Modern Development With MySQL Nicolas De Rico nicolas.de.rico@oracle.com Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes

More information

MySQL Next An overview of the MySQL 8 Beta

MySQL Next An overview of the MySQL 8 Beta MySQL Next An overview of the MySQL 8 Beta Svan Lankes, Cocus AG Carsten Thalheimer, Oracle MySQL Agenda Timelines so far Features Performance MySQL vs. MariaDB vs. Percona Where to get COCUS AG 21.11.2017

More information

Histogram Support in MySQL 8.0

Histogram Support in MySQL 8.0 Histogram Support in MySQL 8.0 Øystein Grøvlen Senior Principal Software Engineer MySQL Optimizer Team, Oracle February 2018 Program Agenda 1 2 3 4 5 Motivating example Quick start guide How are histograms

More information

NoSQL and SQL: The Best of Both Worlds

NoSQL and SQL: The Best of Both Worlds NoSQL and SQL: The Best of Both Worlds Mario Beck MySQL Presales Manager EMEA Mablomy.blogspot.de 5 th November, 2015 Copyright 2015, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement

More information

State of the Dolphin Developing new Apps in MySQL 8

State of the Dolphin Developing new Apps in MySQL 8 State of the Dolphin Developing new Apps in MySQL 8 Highlights of MySQL 8.0 technology updates Mark Swarbrick MySQL Principle Presales Consultant Jill Anolik MySQL Global Business Unit Israel Copyright

More information

MySQL Server 8.0. Geir Høydalsvik. Copyright 2016, 2017, Oracle and/or its its affiliates. All All rights reserved.

MySQL Server 8.0. Geir Høydalsvik. Copyright 2016, 2017, Oracle and/or its its affiliates. All All rights reserved. MySQL Server 8.0 Geir Høydalsvik Copyright 2016, 2017, Oracle and/or its its affiliates. All All rights reserved. Safe Harbor Statement The following is intended to outline our general product direction.

More information

MySQL 5.7: What s New in the Optimizer?

MySQL 5.7: What s New in the Optimizer? MySQL 5.7: What s New in the Optimizer? Manyi Lu, Olav Sandstaa MySQL Optimizer Team, Oracle September, 2015 Copyright 2015, 2014, Oracle and/or its its affiliates. All All rights reserved. Safe Harbor

More information

What's New in MySQL 5.7?

What's New in MySQL 5.7? What's New in MySQL 5.7? Norvald H. Ryeng Software Engineer norvald.ryeng@oracle.com Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information

More information

Practical JSON in MySQL 5.7 and Beyond

Practical JSON in MySQL 5.7 and Beyond Practical JSON in MySQL 5.7 and Beyond Ike Walker GitHub Percona Live April 27, 2017 " How people build software What this talk is about How people build software 2 What this talk is about Using JSON in

More information

Copyright 2017, Oracle and/or its aff iliates. All rights reserved.

Copyright 2017, Oracle and/or its aff iliates. All rights reserved. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment

More information

Flexible Data Modeling in MariaDB

Flexible Data Modeling in MariaDB Flexible Data Modeling in MariaDB WHITE PAPER Part 2 JSON Table of Contents Introduction - Benefits and Limitations - Benefit - Limitations - Use Cases JSON Functions - Definitions - Create - Read - Indexes

More information

Using the MySQL Document Store

Using the MySQL Document Store Using the MySQL Document Store Alfredo Kojima, Sr. Software Dev. Manager, MySQL Mike Zinner, Sr. Software Dev. Director, MySQL Safe Harbor Statement The following is intended to outline our general product

More information

What s New in MariaDB Server Max Mether VP Server

What s New in MariaDB Server Max Mether VP Server What s New in MariaDB Server 10.3 Max Mether VP Server Recap MariaDB 10.2 New in MariaDB 10.2 - GA since May 2017 What s New in 10.2 Analytics SQL Window Functions Common Table Expressions (CTE) JSON JSON

More information

When and How to Take Advantage of New Optimizer Features in MySQL 5.6. Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle

When and How to Take Advantage of New Optimizer Features in MySQL 5.6. Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle When and How to Take Advantage of New Optimizer Features in MySQL 5.6 Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle Program Agenda Improvements for disk-bound queries Subquery improvements

More information

Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage

Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage $ node particle_mysql_all.js Starting... INSERT INTO cloud_data_json (name, data) values ('particle', '{\"data\":\"null\",\"ttl\":60,\"published_at\":\"2017-09-28t19:40:49.869z\",\"coreid\":\"1f0039000947343337373738

More information

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 6 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA

More information

Unit 1 - Chapter 4,5

Unit 1 - Chapter 4,5 Unit 1 - Chapter 4,5 CREATE DATABASE DatabaseName; SHOW DATABASES; USE DatabaseName; DROP DATABASE DatabaseName; CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype,... columnn

More information

Introduction to the MySQL Document Store Alfredo Kojima, Rui Quelhas, Mike Zinner MySQL Middleware and Clients Team October 22, 2018

Introduction to the MySQL Document Store Alfredo Kojima, Rui Quelhas, Mike Zinner MySQL Middleware and Clients Team October 22, 2018 Introduction to the MySQL Document Store Alfredo Kojima, Rui Quelhas, Mike Zinner MySQL Middleware and Clients Team October 22, 2018 Safe Harbor Statement The following is intended to outline our general

More information

Principles of Data Management

Principles of Data Management Principles of Data Management Alvin Lin August 2018 - December 2018 Structured Query Language Structured Query Language (SQL) was created at IBM in the 80s: SQL-86 (first standard) SQL-89 SQL-92 (what

More information

MARIADB & JSON: FLEXIBLE DATA MODELING

MARIADB & JSON: FLEXIBLE DATA MODELING MARIADB & JSON: FLEXIBLE DATA MODELING FEBRUARY 2019 MARIADB PLATFORM Transactions and Analytics, UNITED MariaDB Platform is an enterprise open source database for transactional, analytical or hybrid transactional/analytical

More information

PASSWORDS TREES AND HIERARCHIES. CS121: Relational Databases Fall 2017 Lecture 24

PASSWORDS TREES AND HIERARCHIES. CS121: Relational Databases Fall 2017 Lecture 24 PASSWORDS TREES AND HIERARCHIES CS121: Relational Databases Fall 2017 Lecture 24 Account Password Management 2 Mentioned a retailer with an online website Need a database to store user account details

More information

Exam Questions 1z0-882

Exam Questions 1z0-882 Exam Questions 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer https://www.2passeasy.com/dumps/1z0-882/ 1.Which statement describes the process of normalizing databases? A. All text is trimmed

More information

Optional SQL Feature Summary

Optional SQL Feature Summary Optional SQL Feature Summary The following table lists all optional features included in the SQL standard, from SQL- 2003 to SQL-2016. It also indicates which features that are currently supported by Mimer

More information

Sheeri Cabral. Are You Getting the Best Out of Your MySQL Indexes? Slides

Sheeri Cabral. Are You Getting the Best Out of Your MySQL Indexes? Slides Are You Getting the Best Out of Your MySQL Indexes? Slides http://bit.ly/mysqlindex2 Sheeri Cabral Senior DB Admin/Architect, Mozilla @sheeri www.sheeri.com What is an index? KEY vs. INDEX KEY = KEY CONSTRAINT

More information

CGS 3066: Spring 2017 SQL Reference

CGS 3066: Spring 2017 SQL Reference CGS 3066: Spring 2017 SQL Reference Can also be used as a study guide. Only covers topics discussed in class. This is by no means a complete guide to SQL. Database accounts are being set up for all students

More information

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints SQL KEREM GURBEY WHAT IS SQL Database query language, which can also: Define structure of data Modify data Specify security constraints DATA DEFINITION Data-definition language (DDL) provides commands

More information

Oracle Exam 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Version: 7.0 [ Total Questions: 100 ]

Oracle Exam 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Version: 7.0 [ Total Questions: 100 ] s@lm@n Oracle Exam 1z0-882 Oracle Certified Professional, MySQL 5.6 Developer Version: 7.0 [ Total Questions: 100 ] Oracle 1z0-882 : Practice Test Question No : 1 Consider the statements: Mysql> drop function

More information

Percona Live 2017 Santa Clara, California April 24-27, Rick's RoTs Rules of Thumb for MySQL Rick James

Percona Live 2017 Santa Clara, California April 24-27, Rick's RoTs Rules of Thumb for MySQL Rick James Percona Live 2017 Santa Clara, California April 24-27, 2017 Rick's RoTs Rules of Thumb for MySQL Rick James Agenda Indexing Optimization Partitioning Character Sets Galera/PXC Datatypes How To Hardware

More information

Why we re excited about MySQL 8

Why we re excited about MySQL 8 Why we re excited about MySQL 8 Practical Look for Devs and Ops Peter Zaitsev, CEO, Percona February 4nd, 2018 FOSDEM 1 In the Presentation Practical view on MySQL 8 Exciting things for Devs Exciting things

More information

CSC Web Programming. Introduction to SQL

CSC Web Programming. Introduction to SQL CSC 242 - Web Programming Introduction to SQL SQL Statements Data Definition Language CREATE ALTER DROP Data Manipulation Language INSERT UPDATE DELETE Data Query Language SELECT SQL statements end with

More information

Exact Numeric Data Types

Exact Numeric Data Types SQL Server Notes for FYP SQL data type is an attribute that specifies type of data of any object. Each column, variable and expression has related data type in SQL. You would use these data types while

More information

3 / 120. MySQL 8.0. Frédéric Descamps - MySQL Community Manager - Oracle

3 / 120. MySQL 8.0. Frédéric Descamps - MySQL Community Manager - Oracle 1 / 120 2 / 120 3 / 120 MySQL 8.0 a Document Store with all the benefits of a transactional RDBMS Frédéric Descamps - MySQL Community Manager - Oracle 4 / 120 Save the date! 5 / 120 Safe Harbor Statement

More information

Creating and Managing Tables Schedule: Timing Topic

Creating and Managing Tables Schedule: Timing Topic 9 Creating and Managing Tables Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe the

More information

DB2 SQL Class Outline

DB2 SQL Class Outline DB2 SQL Class Outline The Basics of SQL Introduction Finding Your Current Schema Setting Your Default SCHEMA SELECT * (All Columns) in a Table SELECT Specific Columns in a Table Commas in the Front or

More information

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2 Looking at Performance - What s new in MySQL Workbench 6.2 Mario Beck MySQL Sales Consulting Manager EMEA The following is intended to outline our general product direction. It is

More information

The SQL data-definition language (DDL) allows defining :

The SQL data-definition language (DDL) allows defining : Introduction to SQL Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query Structure Additional Basic Operations Set Operations Null Values Aggregate Functions Nested Subqueries

More information

MySQL Indexing. Best Practices for MySQL 5.6. Peter Zaitsev CEO, Percona MySQL Connect Sep 22, 2013 San Francisco,CA

MySQL Indexing. Best Practices for MySQL 5.6. Peter Zaitsev CEO, Percona MySQL Connect Sep 22, 2013 San Francisco,CA MySQL Indexing Best Practices for MySQL 5.6 Peter Zaitsev CEO, Percona MySQL Connect Sep 22, 2013 San Francisco,CA For those who Does not Know Us Percona Helping Businesses to be Successful with MySQL

More information

SQL Coding Guidelines

SQL Coding Guidelines SQL Coding Guidelines 1. Always specify SET NOCOUNT ON at the top of the stored procedure, this command suppresses the result set count information thereby saving some amount of time spent by SQL Server.

More information

Chapter 3: Introduction to SQL. Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL. Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of The SQL Query Language Data Definition Basic Query

More information

Meet the Sergei Golubchik MariaDB Corporation

Meet the Sergei Golubchik MariaDB Corporation Meet the 10.2 Sergei Golubchik MariaDB Corporation k 10.2 Facts About a year in active development Currently at 10.2.2 beta Plans Gamma soon GA by the end of the year 10.2 Analytical queries Removing historical

More information

Modern SQL: Evolution of a dinosaur

Modern SQL: Evolution of a dinosaur Modern SQL: Evolution of a dinosaur Markus Winand Kraków, 9-11 May 2018 Still using Windows 3.1? So why stick with SQL-92? @ModernSQL - https://modern-sql.com/ @MarkusWinand SQL:1999 WITH (Common Table

More information

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

6232B: Implementing a Microsoft SQL Server 2008 R2 Database 6232B: Implementing a Microsoft SQL Server 2008 R2 Database Course Overview This instructor-led course is intended for Microsoft SQL Server database developers who are responsible for implementing a database

More information

InnoDB: What s new in 8.0

InnoDB: What s new in 8.0 InnoDB: What s new in 8.0 Sunny Bains Director Software Development Copyright 2017, Oracle and/or its its affiliates. All All rights reserved. Safe Harbor Statement The following is intended to outline

More information

COMP 430 Intro. to Database Systems. Indexing

COMP 430 Intro. to Database Systems. Indexing COMP 430 Intro. to Database Systems Indexing How does DB find records quickly? Various forms of indexing An index is automatically created for primary key. SQL gives us some control, so we should understand

More information

MySQL High available by design

MySQL High available by design MySQL High available by design Carsten Thalheimer Sales Consultant MySQL GBU EMEA (Carsten.Thalheimer@Oracle.com) Safe Harbor Statement The following is intended to outline our general product direction.

More information

Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management Tenth Edition Chapter 7 Introduction to Structured Query Language (SQL) Objectives In this chapter, students will learn: The basic commands and

More information

Creating and Working with JSON in Oracle Database

Creating and Working with JSON in Oracle Database Creating and Working with JSON in Oracle Database Dan McGhan Oracle Developer Advocate JavaScript & HTML5 January, 2016 Safe Harbor Statement The following is intended to outline our general product direction.

More information

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS Questions & Answers- DBMS https://career.guru99.com/top-50-database-interview-questions/ 1) Define Database. A prearranged collection of figures known as data is called database. 2) What is DBMS? Database

More information

NoSQL + SQL = MySQL Get the Best of Both Worlds

NoSQL + SQL = MySQL Get the Best of Both Worlds NoSQL + SQL = MySQL Get the Best of Both Worlds Jesper Wisborg Krogh Senior Principal Technical Support Engineer Oracle, MySQL Support October 22, 2018 NEXT 15-MINUTE BRIEFING NoSQL + SQL = MySQL Safe

More information

SQL Part 2. Kathleen Durant PhD Northeastern University CS3200 Lesson 6

SQL Part 2. Kathleen Durant PhD Northeastern University CS3200 Lesson 6 SQL Part 2 Kathleen Durant PhD Northeastern University CS3200 Lesson 6 1 Outline for today More of the SELECT command Review of the SET operations Aggregator functions GROUP BY functionality JOIN construct

More information

GridDB Advanced Edition SQL reference

GridDB Advanced Edition SQL reference GMA022C1 GridDB Advanced Edition SQL reference Toshiba Solutions Corporation 2016 All Rights Reserved. Introduction This manual describes how to write a SQL command in the GridDB Advanced Edition. Please

More information

MySQL Query Tuning 101. Sveta Smirnova, Alexander Rubin April, 16, 2015

MySQL Query Tuning 101. Sveta Smirnova, Alexander Rubin April, 16, 2015 MySQL Query Tuning 101 Sveta Smirnova, Alexander Rubin April, 16, 2015 Agenda 2 Introduction: where to find slow queries Indexes: why and how do they work All about EXPLAIN More tools Where to find more

More information

Chapter 12: Query Processing

Chapter 12: Query Processing Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Overview Chapter 12: Query Processing Measures of Query Cost Selection Operation Sorting Join

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 19 Query Optimization Introduction Query optimization Conducted by a query optimizer in a DBMS Goal: select best available strategy for executing query Based on information available Most RDBMSs

More information

What s New in MySQL 5.7 Geir Høydalsvik, Sr. Director, MySQL Engineering. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

What s New in MySQL 5.7 Geir Høydalsvik, Sr. Director, MySQL Engineering. Copyright 2015, Oracle and/or its affiliates. All rights reserved. What s New in MySQL 5.7 Geir Høydalsvik, Sr. Director, MySQL Engineering Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes

More information

How to Use JSON in MySQL Wrong

How to Use JSON in MySQL Wrong How to Use JSON in MySQL Wrong Bill Karwin, Square Inc. October, 2018 1 Me Database Developer at Square Inc. MySQL Quality Contributor Author of SQL Antipatterns: Avoiding the Pitfalls of Database Programming

More information

Pagina 1 di 7 13.1.7. SELECT Syntax 13.1.7.1. JOIN Syntax 13.1.7.2. UNION Syntax SELECT [ALL DISTINCT DISTINCTROW ] [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]

More information

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel 1 In this chapter, you will learn: The basic commands

More information

Cost-based Query Sub-System. Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Last Class.

Cost-based Query Sub-System. Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Last Class. Cost-based Query Sub-System Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications Queries Select * From Blah B Where B.blah = blah Query Parser Query Optimizer C. Faloutsos A. Pavlo

More information

Upgrading to MySQL 8.0+: a More Automated Upgrade Experience. Dmitry Lenev, Software Developer Oracle/MySQL, November 2018

Upgrading to MySQL 8.0+: a More Automated Upgrade Experience. Dmitry Lenev, Software Developer Oracle/MySQL, November 2018 Upgrading to MySQL 8.0+: a More Automated Upgrade Experience Dmitry Lenev, Software Developer Oracle/MySQL, November 2018 Safe Harbor Statement The following is intended to outline our general product

More information

The query language for relational databases Jef De Smedt

The query language for relational databases Jef De Smedt SQL The query language for relational databases Jef De Smedt Getting to know Βeta vzw, Antwerp 1993 computer training for unemployed 2000 computer training for employees Cevora vzw/cefora asbl ( Fr 15/9

More information

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables INDEX Exercise No Title 1 Basic SQL Statements 2 Restricting and Sorting Data 3 Single Row Functions 4 Displaying data from multiple tables 5 Creating and Managing Tables 6 Including Constraints 7 Manipulating

More information

Advanced Database Systems

Advanced Database Systems Lecture IV Query Processing Kyumars Sheykh Esmaili Basic Steps in Query Processing 2 Query Optimization Many equivalent execution plans Choosing the best one Based on Heuristics, Cost Will be discussed

More information

MySQL Indexing. Best Practices. Peter Zaitsev, CEO Percona Inc August 15, 2012

MySQL Indexing. Best Practices. Peter Zaitsev, CEO Percona Inc August 15, 2012 MySQL Indexing Best Practices Peter Zaitsev, CEO Percona Inc August 15, 2012 You ve Made a Great Choice! Understanding indexing is crucial both for Developers and DBAs Poor index choices are responsible

More information

MariaDB Optimizer. Current state, comparison with other branches, development plans

MariaDB Optimizer. Current state, comparison with other branches, development plans MariaDB Optimizer Current state, comparison with other branches, development plans Sergei Petrunia MariaDB Tampere Unconference June 2018 2 MariaDB 10.2 MariaDB 10.3 MySQL 8.0 MariaDB

More information

MTA Database Administrator Fundamentals Course

MTA Database Administrator Fundamentals Course MTA Database Administrator Fundamentals Course Session 1 Section A: Database Tables Tables Representing Data with Tables SQL Server Management Studio Section B: Database Relationships Flat File Databases

More information

SQL Data Query Language

SQL Data Query Language SQL Data Query Language André Restivo 1 / 68 Index Introduction Selecting Data Choosing Columns Filtering Rows Set Operators Joining Tables Aggregating Data Sorting Rows Limiting Data Text Operators Nested

More information

Introduction to SQL Server 2005/2008 and Transact SQL

Introduction to SQL Server 2005/2008 and Transact SQL Introduction to SQL Server 2005/2008 and Transact SQL Week 2 TRANSACT SQL CRUD Create, Read, Update, and Delete Steve Stedman - Instructor Steve@SteveStedman.com Homework Review Review of homework from

More information

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 304 Introduction to Database Systems SQL DDL Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca SQL Overview Structured Query Language or SQL is the standard query language

More information

SQL functions fit into two broad categories: Data definition language Data manipulation language

SQL functions fit into two broad categories: Data definition language Data manipulation language Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 7 Beginning Structured Query Language (SQL) MDM NUR RAZIA BINTI MOHD SURADI 019-3932846 razia@unisel.edu.my

More information

SQL Data Manipulation Language. Lecture 5. Introduction to SQL language. Last updated: December 10, 2014

SQL Data Manipulation Language. Lecture 5. Introduction to SQL language. Last updated: December 10, 2014 Lecture 5 Last updated: December 10, 2014 Throrought this lecture we will use the following database diagram Inserting rows I The INSERT INTO statement enables inserting new rows into a table. The basic

More information

CAS CS 460/660 Introduction to Database Systems. Query Evaluation II 1.1

CAS CS 460/660 Introduction to Database Systems. Query Evaluation II 1.1 CAS CS 460/660 Introduction to Database Systems Query Evaluation II 1.1 Cost-based Query Sub-System Queries Select * From Blah B Where B.blah = blah Query Parser Query Optimizer Plan Generator Plan Cost

More information

Faloutsos 1. Carnegie Mellon Univ. Dept. of Computer Science Database Applications. Outline

Faloutsos 1. Carnegie Mellon Univ. Dept. of Computer Science Database Applications. Outline Carnegie Mellon Univ. Dept. of Computer Science 15-415 - Database Applications Lecture #14: Implementation of Relational Operations (R&G ch. 12 and 14) 15-415 Faloutsos 1 introduction selection projection

More information

Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query

More information

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database 11g: SQL and PL/SQL Fundamentals Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL

More information

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17 Announcement CompSci 516 Database Systems Lecture 10 Query Evaluation and Join Algorithms Project proposal pdf due on sakai by 5 pm, tomorrow, Thursday 09/27 One per group by any member Instructor: Sudeepa

More information

Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept]

Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept] Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept] 1. What is DBMS? A Database Management System (DBMS) is a program that controls creation, maintenance and use

More information

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #10: Query Processing

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #10: Query Processing CS 4604: Introduction to Database Management Systems B. Aditya Prakash Lecture #10: Query Processing Outline introduction selection projection join set & aggregate operations Prakash 2018 VT CS 4604 2

More information

Database System Concepts

Database System Concepts Chapter 13: Query Processing s Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2008/2009 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth

More information

Query Processing. Debapriyo Majumdar Indian Sta4s4cal Ins4tute Kolkata DBMS PGDBA 2016

Query Processing. Debapriyo Majumdar Indian Sta4s4cal Ins4tute Kolkata DBMS PGDBA 2016 Query Processing Debapriyo Majumdar Indian Sta4s4cal Ins4tute Kolkata DBMS PGDBA 2016 Slides re-used with some modification from www.db-book.com Reference: Database System Concepts, 6 th Ed. By Silberschatz,

More information

Evaluation of relational operations

Evaluation of relational operations Evaluation of relational operations Iztok Savnik, FAMNIT Slides & Textbook Textbook: Raghu Ramakrishnan, Johannes Gehrke, Database Management Systems, McGraw-Hill, 3 rd ed., 2007. Slides: From Cow Book

More information

Introduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe

Introduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Query Processing and Query Optimization Techniques Outline Translating SQL Queries into Relational Algebra Algorithms for External Sorting Algorithms for SELECT and JOIN Operations Algorithms

More information

Oracle Database: SQL and PL/SQL Fundamentals Ed 2

Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

Chapter 12: Query Processing. Chapter 12: Query Processing

Chapter 12: Query Processing. Chapter 12: Query Processing Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Query Processing Overview Measures of Query Cost Selection Operation Sorting Join

More information

Explaining the MySQL EXPLAIN

Explaining the MySQL EXPLAIN Explaining the MySQL EXPLAIN Ronald Bradford http://ronaldbradford.com OTN South America Tour July 2011 Agenda EXPLAIN syntax options How to read QEP QEP examples MySQL optimizer limitations PURPOSE EXPLAIN

More information

<Insert Picture Here> Boosting performance with MySQL partitions

<Insert Picture Here> Boosting performance with MySQL partitions Boosting performance with MySQL partitions Giuseppe Maxia MySQL Community Team Lead at Oracle 1 about me -Giuseppe Maxia a.k.a. The Data Charmer MySQL Community Team Lead Long time

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

Assignment 6: SQL III Solution

Assignment 6: SQL III Solution Data Modelling and Databases Exercise dates: April 12/April 13, 2018 Ce Zhang, Gustavo Alonso Last update: April 16, 2018 Spring Semester 2018 Head TA: Ingo Müller Assignment 6: SQL III Solution This assignment

More information

IBM DB2 UDB V7.1 Family Fundamentals.

IBM DB2 UDB V7.1 Family Fundamentals. IBM 000-512 DB2 UDB V7.1 Family Fundamentals http://killexams.com/exam-detail/000-512 Answer: E QUESTION: 98 Given the following: A table containing a list of all seats on an airplane. A seat consists

More information

Evaluation of Relational Operations. Relational Operations

Evaluation of Relational Operations. Relational Operations Evaluation of Relational Operations Chapter 14, Part A (Joins) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Relational Operations v We will consider how to implement: Selection ( )

More information

Querying Data with Transact SQL

Querying Data with Transact SQL Course 20761A: Querying Data with Transact SQL Course details Course Outline Module 1: Introduction to Microsoft SQL Server 2016 This module introduces SQL Server, the versions of SQL Server, including

More information