The document discusses optimization of MySQL performance. It includes an agenda for the presentation which covers strategic considerations, schema optimization through normalization and indexing, and query optimization. Examples provided demonstrate summary and cache tables to improve query performance through de-normalization, and techniques for indexing and handling concurrency issues.
The document discusses MySQL query optimization. It covers the query optimizer, principles of optimization like using EXPLAIN and profiling, indexes, JOIN optimization, and ORDER BY/GROUP BY optimization. The key points are to identify bottlenecks, use indexes on frequently filtered fields, avoid indexes on fields that change often or contain many duplicates, and consider composite indexes to cover multiple queries.
This document describes Axelisys, a lean-enterprise architecture firm based in Manchester, UK. It provides an overview of the company's history, services, and approach. Axelisys was founded in 2011 and employs 1-40 permanent and freelance staff. It specializes in applying lean and agile principles to help businesses optimize their IT investments and achieve continuous improvement. The document demonstrates this through examples and games, emphasizing principles like minimizing waste, aligning work to customer value, keeping work packages small, and prioritizing quality. It positions Microsoft Dynamics 365 as a solution that can help businesses address various types of waste.
Search and nosql for information management @nosqlmatters CologneLucian Precup
The document discusses using a search engine like Elasticsearch to power the search functionality for an information management application. It describes how Elasticsearch can provide benefits like fast full-text search, autocomplete, faceting and other features out of the box. It also addresses challenges of integrating the search index with relational data and solutions like using the service layer to handle synchronization between databases.
The document outlines Eli Aschkenasy's presentation on nested data sets. The agenda includes an introduction, explanation of nested data sets, types of hierarchies, using nested sets in Joomla, basic functions, advanced functions, and "ten commandments". Examples are provided of SQL queries to find the root node, leaf nodes, and basic functions in Joomla for working with nested data sets.
Machine Learning From Raw Data To The PredictionsLuca Zavarella
The document discusses machine learning concepts and Azure Machine Learning. It begins with an introduction to Azure ML services and environment. It then covers important steps for data preparation, including checking for missing values and outliers, performing feature engineering and selection. Common machine learning algorithms are also outlined, such as regression, classification, clustering and anomaly detection. The presentation concludes with a demonstration of how to build a predictive model for price elasticity using Azure ML Studio.
MySQL Indexes and Histograms - RMOUG Training Days 2022Dave Stokes
Nobody complains when the database is too fast. But they do gripe when it slows down. The two most popular ways to increase query speed are indexes and histograms. But there a dozens of options for indexes and a lot of lots of bad information on how to use them. Histograms are great but not for all types of data. This session covers the hows and whys of both approaches
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...Dave Stokes
This document discusses various ways to speed up queries in MySQL, including the proper use of indexes, histograms, and locking options. It begins with an introduction to indexes, explaining that indexes are data structures that improve the speed of data retrieval by allowing for faster lookups and access to ordered records. The document then covers different types of indexes like clustered indexes, secondary indexes, functional indexes, and multi-value indexes. It emphasizes choosing indexes carefully based on the most common queries and selecting columns that are not often updated. Overall, the document provides an overview of optimization techniques in MySQL with a focus on index usage.
The document discusses MySQL query optimization. It covers the query optimizer, principles of optimization like using EXPLAIN and profiling, indexes, JOIN optimization, and ORDER BY/GROUP BY optimization. The key points are to identify bottlenecks, use indexes on frequently filtered fields, avoid indexes on fields that change often or contain many duplicates, and consider composite indexes to cover multiple queries.
This document describes Axelisys, a lean-enterprise architecture firm based in Manchester, UK. It provides an overview of the company's history, services, and approach. Axelisys was founded in 2011 and employs 1-40 permanent and freelance staff. It specializes in applying lean and agile principles to help businesses optimize their IT investments and achieve continuous improvement. The document demonstrates this through examples and games, emphasizing principles like minimizing waste, aligning work to customer value, keeping work packages small, and prioritizing quality. It positions Microsoft Dynamics 365 as a solution that can help businesses address various types of waste.
Search and nosql for information management @nosqlmatters CologneLucian Precup
The document discusses using a search engine like Elasticsearch to power the search functionality for an information management application. It describes how Elasticsearch can provide benefits like fast full-text search, autocomplete, faceting and other features out of the box. It also addresses challenges of integrating the search index with relational data and solutions like using the service layer to handle synchronization between databases.
The document outlines Eli Aschkenasy's presentation on nested data sets. The agenda includes an introduction, explanation of nested data sets, types of hierarchies, using nested sets in Joomla, basic functions, advanced functions, and "ten commandments". Examples are provided of SQL queries to find the root node, leaf nodes, and basic functions in Joomla for working with nested data sets.
Machine Learning From Raw Data To The PredictionsLuca Zavarella
The document discusses machine learning concepts and Azure Machine Learning. It begins with an introduction to Azure ML services and environment. It then covers important steps for data preparation, including checking for missing values and outliers, performing feature engineering and selection. Common machine learning algorithms are also outlined, such as regression, classification, clustering and anomaly detection. The presentation concludes with a demonstration of how to build a predictive model for price elasticity using Azure ML Studio.
MySQL Indexes and Histograms - RMOUG Training Days 2022Dave Stokes
Nobody complains when the database is too fast. But they do gripe when it slows down. The two most popular ways to increase query speed are indexes and histograms. But there a dozens of options for indexes and a lot of lots of bad information on how to use them. Histograms are great but not for all types of data. This session covers the hows and whys of both approaches
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...Dave Stokes
This document discusses various ways to speed up queries in MySQL, including the proper use of indexes, histograms, and locking options. It begins with an introduction to indexes, explaining that indexes are data structures that improve the speed of data retrieval by allowing for faster lookups and access to ordered records. The document then covers different types of indexes like clustered indexes, secondary indexes, functional indexes, and multi-value indexes. It emphasizes choosing indexes carefully based on the most common queries and selecting columns that are not often updated. Overall, the document provides an overview of optimization techniques in MySQL with a focus on index usage.
Hidden Treasures in Google Analytics - SMX East 2011 - Adam WareSwellPath
All analytics packages come with dozens, if not hundreds of reports that slice, dice and segment countless variables, all purporting to offer comprehensive metrics about the performance of your search marketing campaign. While many of these reports are great, you can often get much deeper insights – and “ah-ha” takeaways – from lesser known or even undocumented reporting options. Speakers in this session show you how to tap into these undiscovered gems.
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDave Stokes
This document discusses how to speed up queries in MySQL through the proper use of indexes, histograms, and other techniques. It begins by explaining that the MySQL optimizer tries to determine the most efficient way to execute queries by considering different query plans. The optimizer relies on statistics about column distributions to estimate query costs. The document then discusses using EXPLAIN to view and analyze query plans, and how indexes can improve query performance by allowing faster data retrieval through secondary indexes and other index types. Proper index selection and column data types are important to allow the optimizer to use indexes efficiently.
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Dave Stokes
Speeding up queries on a MySQL server with indexes and histograms is not a mysterious art but simple engineering. This presentation is an indepth introduction that was presented on March 30th to the Quest Insynch and Open Source 101 conferences
Dalam webinar ini, kami mengajak anda untuk mengenal proses tuning performa MySQL database. Kita akan melakukan review best practices, opsi konfigurasi yg penting, diskusi ttg inisial MySQL config file, monitoring dan lain lain.
Mari mengenal bagaimana menemukan kueri yang paling membutuhkan optimasi menggunakan laporan kinerja di MySQL Workbench, MySQL Enterprise Monitor, atau melalui sys schema.
Many companies have invested time and money into building sophisticated data pipelines that can move massive amounts of data, often in real time. However, for the analyst or data scientist who builds offline models, integrating their analyses into these pipelines for operational purposes can pose a challenge.
In this slide deck, we will discuss some key technologies and workflows companies can leverage to build end-to-end solutions for automating statistical and machine learning solutions: from collection and storage to analysis and real-time predictions.
This document summarizes Timo Pertilä's PowerApps deep dive presentation at the SPS EVENTS conference. It discusses PowerApps canvas vs model-driven apps, how to handle large datasets using different data sources like SharePoint lists, SQL databases, and CDS for Apps. It provides tips on improving app performance by reducing screens/controls and checking for expensive operations. It emphasizes starting governance planning early and not overestimating capabilities of SharePoint lists or SQL databases.
SEMrush- 5 Hours of SEO - Scaling Ranking Data AnalysisAlexis Sanders
Nik Ranger
We don’t always have access to first-party data (), buuuut luckily, we can use third-party data to develop our understanding and help derive directional business intelligence and insights ().
During the session, we are going to spend 15 minutes going through one method of gleaning insights from a large-scale ranking dataset. Using SEMrush’s organic ranking report* (our sizeable third-party dataset for today), we’re going to:
Segment keywords into different subsets using a Jupyter Notebook (including brand/non-brand, SERP intent, intents, question words, etc.),
Load the data into Power Bi*,
Visualize some data to support identifying insights.
If you love content, ranking analyses, or are passionate about efficiencies in reporting, you’re going to enjoy the fifth session of 5 Hours of SEO with Alexis Sanders!
*Note: regardless of your toolset (for ranking and BI visualization), this methodology can help you identify insights.
This thirty-minute session was hosted by Nik Ranger.
Confoo 2021 - MySQL Indexes & HistogramsDave Stokes
Confoo 2021 presentation on MySQL Indexes, Histograms, and other ways to speed up your queries. This slide deck has slides that may not have been included in the presentation that were omitted due to time constraints
Alexis Sanders — Scaling Ranking Data Analysis: Organizing, Visualizing, and ...Semrush
1. The document discusses segmenting, organizing, and visualizing SEMrush ranking data for Chipotle using Jupyter Notebook and Power BI.
2. Key steps include getting SEMrush data, using Python code to segment keywords by brand and intent, exporting the categorized data, and loading it into Power BI for visualization.
3. Examples of visualizations shown include top subdomains, SERP intents, products by meat, and non-brand keywords by traffic and cost.
Technical marketers are in high demand and low supply. Being able to dive into data on your own, with no help from engineering, makes you a much better marketer.
This is why SQL is so powerful - it allows you to see any data you want about anything your customers do. Knowing how to use SQL is literally a marketing superpower.
In this SQL tutorial specifically for marketers, I've pulled together SQL query basics that any marketer or data analyst will need to dig into their customer analytics. This course is the best resource for marketers, growth hackers and product managers who want to get more technical and learn SQL. It's what I wish existed when I was going through tutorial after tutorial, sifting through lots of information that didn't apply to me and trying to learn on my own.
SQL is simple enough that - just by learning a few concepts I cover above - you'll be able to use it for any kind of data analysis, cohort analysis or campaign breakdown.
Want more information? Check out resources on my blog - http://justinmares.com/sql
Tactical Data Science Tips: Python and Spark TogetherDatabricks
This document summarizes a talk given by Bill Chambers on processing data with Spark and Python. It discusses 5 ways to process data: RDDs, DataFrames, Koalas, UDFs, and pandasUDFs. It then covers two data science use cases - growth forecasting and churn prediction - and how they were implemented using these different processing methods based on characteristics like the number of input rows, features, and required models. The talk emphasizes using DataFrames and pandasUDFs for optimal performance and flexibility. It also highlights tracking models with MLFlow for consistency in production.
The document discusses Oracle's cost-based optimizer. It provides the following key points:
1. The optimizer's cost estimate is based on the number of rows (cardinality), how clustered the data is, and caching, but it does not consider caching prior to 11g.
2. Cardinality and clustering determine whether a "big job" full table scan strategy or "small job" index scan strategy should be preferred.
3. Accurate statistics like histograms are important for the optimizer to estimate cardinality correctly and choose an efficient execution plan. However, histograms have limitations in representing all data patterns.
What's Your Super-Power? Mine is Machine Learning with Oracle Autonomous DB.Jim Czuprynski
The document discusses leveraging machine learning capabilities with Oracle Autonomous Database and other Oracle technologies. It provides credentials for the author and an overview of several Oracle machine learning and analytics tools, including Oracle Machine Learning (OML), Oracle Analytics Cloud (OAC), and Application Express (APEX). Examples are given of building analyses with these tools using sample datasets on topics like voter demographics and electoral data. Useful documentation resources are also referenced.
The document discusses proper techniques for defining and measuring service level objectives (SLOs). It begins with an overview of SLOs, service level indicators (SLIs), and service level agreements (SLAs). It then describes a common mistake in averaging percentiles across data sets. The rest of the document discusses different methods for accurately computing SLOs using log data, counting requests, and histograms. It argues that histograms provide the most flexibility while avoiding issues with averaging percentiles.
Watch the full webinar at: http://embt.co/1pb4Zb4
This presentation is a must-see for anyone interested in Oracle 12! Dan is an Oracle ACE Director and has assembled this presentation with fresh and inside information from Oracle Corp and OOW13. Dan has pulled his top Oracle 12 features from the plethora of new features available and documented in his user group presentations "Oracle 12c New Features for Developers" and "Oracle 12c New Features for DBA's".
Top 10 features will include:
New SQL Syntax
New SQL and PL/SQL Limits
Pluggable Database
New Packages
Deprecated Features
New SQL Tuning Features
This presentation covers new SQL & PL/SQL syntax and options, the container DB of course, new SQL optimizer features, deprecated features, hints, and more. If you're supporting applications, then you won't want to miss this webinar!
Unlock the value in your big data reservoir using oracle big data discovery a...Mark Rittman
The document discusses Oracle Big Data Discovery and how it can be used to analyze and gain insights from data stored in a Hadoop data reservoir. It provides an example scenario where Big Data Discovery is used to analyze website logs, tweets, and website posts and comments to understand popular content and influencers for a company. The data is ingested into the Big Data Discovery tool, which automatically enriches the data. Users can then explore the data, apply additional transformations, and visualize relationships to gain insights.
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...Harry McLaren
We explore "Metrics, mstats and Me: Splunking Human Data” and also have some insights into the KV Store and javascript use in dashboards. We’ll also re-cover the conf18 updates for those who couldn’t attend our last session.
Find Anything In Your APEX App - Fuzzy Search with Oracle TextCarsten Czarski
Ever had a requirement to add fuzzy search to your APEX application ...? And did you know that Oracle Database and APEX provide everything you need?
This Application Express Office Hours session will show how to provide error-tolerant searching to your end users using Application Express and the Oracle TEXT database feature. Oracle TEXT allows to build just one Index for all your data and it provides linguistic and fuzzy search capabilities. The APEX Interactive Grid component allows to declaratively integrate such an index - however, other APEX components can leverage Oracle TEXT as well. The session will show how to build the Oracle Text index and how to use it with various APEX components. Tips and Tricks for practical usage will wrap the session up.
Andreas Zeller's keynote at the 1st Intl Fuzzing workshop 2022 at NDSS: https://fuzzingworkshop.github.io/program.html
Do you fuzz your own program, or do you fuzz someone else's program? The answer to this question has vast consequences on your view on fuzzing. Fuzzing someone else's program is the typical adverse "security tester" perspective, where you want your fuzzer to be as automatic and versatile as possible. Fuzzing your own code, however, is more like a traditional tester perspective, where you may assume some knowledge about the program and its context, but may also want to _exploit_ this knowledge - say, to direct the fuzzer to critical locations.
In this talk, I detail these differences in perspectives and assumptions, and highlight their consequences for fuzzer design and research. I also highlight cultural differences in the research communities, and what happens if you submit a paper to the wrong community. I close with an outlook into our newest frameworks, set to reconcile these perspectives by giving users unprecedented control over fuzzing, yet staying fully automatic if need be.
Bio: Andreas Zeller is faculty at the CISPA Helmholtz Center for Information Security and a professor for Software Engineering at Saarland University, both in Saarbrücken, Germany. His research on automated debugging, mining software archives, specification mining, and security testing has won several awards for its impact in academia and industry. Zeller is an ACM Fellow, an IFIP Fellow, an ERC Advanced Grant Awardee, and holds an ACM SIGSOFT Outstanding Research Award.
The document summarizes a presentation by Arden Thomas on the Cincom Smalltalk 2018 roadmap. It provides an overview of Cincom's history developing database technologies and Smalltalk products. Thomas discusses themes of emphasizing the positives and simplicity. The presentation covers advocating for Smalltalk by discussing pearls, hidden gems, vocabulary, principles and thought exercises. It also briefly outlines Cincom Smalltalk products and future directions before concluding with contact information.
Project Management: The Role of Project Dashboards.pdfKarya Keeper
Project management is a crucial aspect of any organization, ensuring that projects are completed efficiently and effectively. One of the key tools used in project management is the project dashboard, which provides a comprehensive view of project progress and performance. In this article, we will explore the role of project dashboards in project management, highlighting their key features and benefits.
Hidden Treasures in Google Analytics - SMX East 2011 - Adam WareSwellPath
All analytics packages come with dozens, if not hundreds of reports that slice, dice and segment countless variables, all purporting to offer comprehensive metrics about the performance of your search marketing campaign. While many of these reports are great, you can often get much deeper insights – and “ah-ha” takeaways – from lesser known or even undocumented reporting options. Speakers in this session show you how to tap into these undiscovered gems.
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDave Stokes
This document discusses how to speed up queries in MySQL through the proper use of indexes, histograms, and other techniques. It begins by explaining that the MySQL optimizer tries to determine the most efficient way to execute queries by considering different query plans. The optimizer relies on statistics about column distributions to estimate query costs. The document then discusses using EXPLAIN to view and analyze query plans, and how indexes can improve query performance by allowing faster data retrieval through secondary indexes and other index types. Proper index selection and column data types are important to allow the optimizer to use indexes efficiently.
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Dave Stokes
Speeding up queries on a MySQL server with indexes and histograms is not a mysterious art but simple engineering. This presentation is an indepth introduction that was presented on March 30th to the Quest Insynch and Open Source 101 conferences
Dalam webinar ini, kami mengajak anda untuk mengenal proses tuning performa MySQL database. Kita akan melakukan review best practices, opsi konfigurasi yg penting, diskusi ttg inisial MySQL config file, monitoring dan lain lain.
Mari mengenal bagaimana menemukan kueri yang paling membutuhkan optimasi menggunakan laporan kinerja di MySQL Workbench, MySQL Enterprise Monitor, atau melalui sys schema.
Many companies have invested time and money into building sophisticated data pipelines that can move massive amounts of data, often in real time. However, for the analyst or data scientist who builds offline models, integrating their analyses into these pipelines for operational purposes can pose a challenge.
In this slide deck, we will discuss some key technologies and workflows companies can leverage to build end-to-end solutions for automating statistical and machine learning solutions: from collection and storage to analysis and real-time predictions.
This document summarizes Timo Pertilä's PowerApps deep dive presentation at the SPS EVENTS conference. It discusses PowerApps canvas vs model-driven apps, how to handle large datasets using different data sources like SharePoint lists, SQL databases, and CDS for Apps. It provides tips on improving app performance by reducing screens/controls and checking for expensive operations. It emphasizes starting governance planning early and not overestimating capabilities of SharePoint lists or SQL databases.
SEMrush- 5 Hours of SEO - Scaling Ranking Data AnalysisAlexis Sanders
Nik Ranger
We don’t always have access to first-party data (), buuuut luckily, we can use third-party data to develop our understanding and help derive directional business intelligence and insights ().
During the session, we are going to spend 15 minutes going through one method of gleaning insights from a large-scale ranking dataset. Using SEMrush’s organic ranking report* (our sizeable third-party dataset for today), we’re going to:
Segment keywords into different subsets using a Jupyter Notebook (including brand/non-brand, SERP intent, intents, question words, etc.),
Load the data into Power Bi*,
Visualize some data to support identifying insights.
If you love content, ranking analyses, or are passionate about efficiencies in reporting, you’re going to enjoy the fifth session of 5 Hours of SEO with Alexis Sanders!
*Note: regardless of your toolset (for ranking and BI visualization), this methodology can help you identify insights.
This thirty-minute session was hosted by Nik Ranger.
Confoo 2021 - MySQL Indexes & HistogramsDave Stokes
Confoo 2021 presentation on MySQL Indexes, Histograms, and other ways to speed up your queries. This slide deck has slides that may not have been included in the presentation that were omitted due to time constraints
Alexis Sanders — Scaling Ranking Data Analysis: Organizing, Visualizing, and ...Semrush
1. The document discusses segmenting, organizing, and visualizing SEMrush ranking data for Chipotle using Jupyter Notebook and Power BI.
2. Key steps include getting SEMrush data, using Python code to segment keywords by brand and intent, exporting the categorized data, and loading it into Power BI for visualization.
3. Examples of visualizations shown include top subdomains, SERP intents, products by meat, and non-brand keywords by traffic and cost.
Technical marketers are in high demand and low supply. Being able to dive into data on your own, with no help from engineering, makes you a much better marketer.
This is why SQL is so powerful - it allows you to see any data you want about anything your customers do. Knowing how to use SQL is literally a marketing superpower.
In this SQL tutorial specifically for marketers, I've pulled together SQL query basics that any marketer or data analyst will need to dig into their customer analytics. This course is the best resource for marketers, growth hackers and product managers who want to get more technical and learn SQL. It's what I wish existed when I was going through tutorial after tutorial, sifting through lots of information that didn't apply to me and trying to learn on my own.
SQL is simple enough that - just by learning a few concepts I cover above - you'll be able to use it for any kind of data analysis, cohort analysis or campaign breakdown.
Want more information? Check out resources on my blog - http://justinmares.com/sql
Tactical Data Science Tips: Python and Spark TogetherDatabricks
This document summarizes a talk given by Bill Chambers on processing data with Spark and Python. It discusses 5 ways to process data: RDDs, DataFrames, Koalas, UDFs, and pandasUDFs. It then covers two data science use cases - growth forecasting and churn prediction - and how they were implemented using these different processing methods based on characteristics like the number of input rows, features, and required models. The talk emphasizes using DataFrames and pandasUDFs for optimal performance and flexibility. It also highlights tracking models with MLFlow for consistency in production.
The document discusses Oracle's cost-based optimizer. It provides the following key points:
1. The optimizer's cost estimate is based on the number of rows (cardinality), how clustered the data is, and caching, but it does not consider caching prior to 11g.
2. Cardinality and clustering determine whether a "big job" full table scan strategy or "small job" index scan strategy should be preferred.
3. Accurate statistics like histograms are important for the optimizer to estimate cardinality correctly and choose an efficient execution plan. However, histograms have limitations in representing all data patterns.
What's Your Super-Power? Mine is Machine Learning with Oracle Autonomous DB.Jim Czuprynski
The document discusses leveraging machine learning capabilities with Oracle Autonomous Database and other Oracle technologies. It provides credentials for the author and an overview of several Oracle machine learning and analytics tools, including Oracle Machine Learning (OML), Oracle Analytics Cloud (OAC), and Application Express (APEX). Examples are given of building analyses with these tools using sample datasets on topics like voter demographics and electoral data. Useful documentation resources are also referenced.
The document discusses proper techniques for defining and measuring service level objectives (SLOs). It begins with an overview of SLOs, service level indicators (SLIs), and service level agreements (SLAs). It then describes a common mistake in averaging percentiles across data sets. The rest of the document discusses different methods for accurately computing SLOs using log data, counting requests, and histograms. It argues that histograms provide the most flexibility while avoiding issues with averaging percentiles.
Watch the full webinar at: http://embt.co/1pb4Zb4
This presentation is a must-see for anyone interested in Oracle 12! Dan is an Oracle ACE Director and has assembled this presentation with fresh and inside information from Oracle Corp and OOW13. Dan has pulled his top Oracle 12 features from the plethora of new features available and documented in his user group presentations "Oracle 12c New Features for Developers" and "Oracle 12c New Features for DBA's".
Top 10 features will include:
New SQL Syntax
New SQL and PL/SQL Limits
Pluggable Database
New Packages
Deprecated Features
New SQL Tuning Features
This presentation covers new SQL & PL/SQL syntax and options, the container DB of course, new SQL optimizer features, deprecated features, hints, and more. If you're supporting applications, then you won't want to miss this webinar!
Unlock the value in your big data reservoir using oracle big data discovery a...Mark Rittman
The document discusses Oracle Big Data Discovery and how it can be used to analyze and gain insights from data stored in a Hadoop data reservoir. It provides an example scenario where Big Data Discovery is used to analyze website logs, tweets, and website posts and comments to understand popular content and influencers for a company. The data is ingested into the Big Data Discovery tool, which automatically enriches the data. Users can then explore the data, apply additional transformations, and visualize relationships to gain insights.
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...Harry McLaren
We explore "Metrics, mstats and Me: Splunking Human Data” and also have some insights into the KV Store and javascript use in dashboards. We’ll also re-cover the conf18 updates for those who couldn’t attend our last session.
Find Anything In Your APEX App - Fuzzy Search with Oracle TextCarsten Czarski
Ever had a requirement to add fuzzy search to your APEX application ...? And did you know that Oracle Database and APEX provide everything you need?
This Application Express Office Hours session will show how to provide error-tolerant searching to your end users using Application Express and the Oracle TEXT database feature. Oracle TEXT allows to build just one Index for all your data and it provides linguistic and fuzzy search capabilities. The APEX Interactive Grid component allows to declaratively integrate such an index - however, other APEX components can leverage Oracle TEXT as well. The session will show how to build the Oracle Text index and how to use it with various APEX components. Tips and Tricks for practical usage will wrap the session up.
Andreas Zeller's keynote at the 1st Intl Fuzzing workshop 2022 at NDSS: https://fuzzingworkshop.github.io/program.html
Do you fuzz your own program, or do you fuzz someone else's program? The answer to this question has vast consequences on your view on fuzzing. Fuzzing someone else's program is the typical adverse "security tester" perspective, where you want your fuzzer to be as automatic and versatile as possible. Fuzzing your own code, however, is more like a traditional tester perspective, where you may assume some knowledge about the program and its context, but may also want to _exploit_ this knowledge - say, to direct the fuzzer to critical locations.
In this talk, I detail these differences in perspectives and assumptions, and highlight their consequences for fuzzer design and research. I also highlight cultural differences in the research communities, and what happens if you submit a paper to the wrong community. I close with an outlook into our newest frameworks, set to reconcile these perspectives by giving users unprecedented control over fuzzing, yet staying fully automatic if need be.
Bio: Andreas Zeller is faculty at the CISPA Helmholtz Center for Information Security and a professor for Software Engineering at Saarland University, both in Saarbrücken, Germany. His research on automated debugging, mining software archives, specification mining, and security testing has won several awards for its impact in academia and industry. Zeller is an ACM Fellow, an IFIP Fellow, an ERC Advanced Grant Awardee, and holds an ACM SIGSOFT Outstanding Research Award.
The document summarizes a presentation by Arden Thomas on the Cincom Smalltalk 2018 roadmap. It provides an overview of Cincom's history developing database technologies and Smalltalk products. Thomas discusses themes of emphasizing the positives and simplicity. The presentation covers advocating for Smalltalk by discussing pearls, hidden gems, vocabulary, principles and thought exercises. It also briefly outlines Cincom Smalltalk products and future directions before concluding with contact information.
Similar to MySQL Performance Optimization #JDNL13 (20)
Project Management: The Role of Project Dashboards.pdfKarya Keeper
Project management is a crucial aspect of any organization, ensuring that projects are completed efficiently and effectively. One of the key tools used in project management is the project dashboard, which provides a comprehensive view of project progress and performance. In this article, we will explore the role of project dashboards in project management, highlighting their key features and benefits.
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...kalichargn70th171
In today's business landscape, digital integration is ubiquitous, demanding swift innovation as a necessity rather than a luxury. In a fiercely competitive market with heightened customer expectations, the timely launch of flawless digital products is crucial for both acquisition and retention—any delay risks ceding market share to competitors.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
16. STRATEGIC OVERVIEW
• Find smart people – Learn from them
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 4
17. STRATEGIC OVERVIEW
• Find smart people – Learn from them
• Find less knowledgeable people – Teach them (great design
benefits)
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 4
18. STRATEGIC OVERVIEW
• Find smart people – Learn from them
• Find less knowledgeable people – Teach them (great design benefits)
• Talk to the business people! – Become their marketing specialist
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 4
19. STRATEGIC OVERVIEW
• Find smart people – Learn from them
• Find less knowledgeable people – Teach them (great design benefits)
• Talk to the business people! – Become their marketing specialist
• Benchmark – Do It !!!!!!!!!!
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 4
20. STRATEGIC OVERVIEW
• Find smart people – Learn from them
• Find less knowledgeable people – Teach them (great design benefits)
• Talk to the business people! – Become their marketing specialist
• Benchmark – Do It !!!!!!!!!!
• Decide early
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 4
23. DESIGN CONSIDERATIONS
SCHEMA OPTIMIZATION – STRATEGIC
• DB Engines (InnoDB vs. MyISAM) – not including MySQL 5.6
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 6
24. InnoDB
• Transactional
• Hot (Online) Backup
• Crash Safe(er)
MyISAM
• Full-Text Indexing
• Compression
• Low(er) Space Consumption
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 7
26. InnoDB
• Transactional
• Hot (Online) Backup
• Crash Safe(er)
MyISAM
• Full-Text Indexing
• Compression
• Low(er) Space Consumption
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 7
• Always!
• Transactional
• Logging
• Read Only
27. DESIGN CONSIDERATIONS
SCHEMA OPTIMIZATION – STRATEGIC
• DB Engines (InnoDB vs. MyISAM) – not including MySQL 5.6
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 8
28. DESIGN CONSIDERATIONS
SCHEMA OPTIMIZATION – STRATEGIC
• DB Engines (InnoDB vs. MyISAM) – not including MySQL 5.6
• Data Types (Numbers, Strings, Special)
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 8
30. NUMBERS
INT(1) vs. INT(20) ? (trick question)
UNSIGNED vs. SIGNED
FLOAT isn’t accurate but fast
DECIMAL in MySQL<4.1 calculated
as FLOAT
DECIMAL needs additional byte to
store decimal point
Think if BIGINT could be used even
for precise calculations
(x*1’000’000)
PLEASE, PLEASE, use unsigned
integer as primary index. (we’ll
talk about it later again).
STRINGS SPECIAL
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 9
31. NUMBERS
INT(1) vs. INT(20) ? (trick question)
UNSIGNED vs. SIGNED
FLOAT isn’t accurate but fast
DECIMAL in MySQL<4.1 calculated
as FLOAT
DECIMAL needs additional byte to
store decimal point
Think if BIGINT could be used even
for precise calculations
(x*1’000’000)
PLEASE, PLEASE, use unsigned
integer as primary index. (we’ll
talk about it later again).
STRINGS
Use CHAR for fixed length columns
US States is the best example
State code are perfect for
TINYINT UNSIGNED
MD5 Hash values are
another good candidate for
CHAR usage
VARCHAR requires length byte!
VARCHAR allocates space in chunks
so don’t be overly generous
TEXT is problematic in SORTs
Trick: Use SUBSTRING(x, fixed) to
alleviate the problem
SPECIAL
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 9
32. NUMBERS
INT(1) vs. INT(20) ? (trick question)
UNSIGNED vs. SIGNED
FLOAT isn’t accurate but fast
DECIMAL in MySQL<4.1 calculated
as FLOAT
DECIMAL needs additional byte to
store decimal point
Think if BIGINT could be used even
for precise calculations
(x*1’000’000)
PLEASE, PLEASE, use unsigned
integer as primary index. (we’ll
talk about it later again).
STRINGS
Use CHAR for fixed length columns
US States is the best example
State code are perfect for
TINYINT UNSIGNED
MD5 Hash values are
another good candidate for
CHAR usage
VARCHAR requires length byte!
VARCHAR allocates space in chunks
so don’t be overly generous
TEXT is problematic in SORTs
Trick: Use SUBSTRING(x, fixed) to
alleviate the problem
SPECIAL
Avoid NULL if possible
Harder for MySQL to
optimize query
Use TIMESTAMP instead of DATETIME
Limit 2038
EST
TIMESTAMP uses less
space
(I hardly ever use TIMESTAMP…)
BIT (actually string form)
Don’t use ENUM or SET
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 9
33. CODE EXAMPLES - BIT
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 10
mysql> CREATE TABLE bittest(a bit(8));
mysql> INSERT INTO bittest VALUES(b'00111001');
mysql> SELECT a, a + 0 FROM bittest;
+------+-------+
| a | a + 0 |
+------+-------+
| 9 | 57 |
+------+-------+
34. CODE EXAMPLES - ENUM
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 11
mysql> CREATE TABLE enum_test(e ENUM('fish', 'apple', 'dog') NOT NULL);
mysql> INSERT INTO enum_test(e) VALUES('fish'), ('dog'), ('apple');
mysql> SELECT e + 0 FROM enum_test; mysql> SELECT e FROM enum_test ORDER
BY e;
+-------+
| e + 0 |
+-------+
| 1 |
| 3 |
| 2 |
+-------+
35. CODE EXAMPLES - ENUM
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 11
mysql> CREATE TABLE enum_test(e ENUM('fish', 'apple', 'dog') NOT NULL);
mysql> INSERT INTO enum_test(e) VALUES('fish'), ('dog'), ('apple');
mysql> SELECT e + 0 FROM enum_test; mysql> SELECT e FROM enum_test ORDER
BY e;
+-------+
| e + 0 |
+-------+
| 1 |
| 3 |
| 2 |
+-------+
+-------+
| e |
+-------+
| fish |
| apple |
| dog |
+-------+
36. CODE EXAMPLES – DATETIME NOT NULL
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 12
DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00‘
39. DESIGN CONSIDERATIONS
SCHEMA OPTIMIZATION – NORMALIZATION
• Normalized data is non-redundant
(Text book says this is the best option)
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 14
40. DESIGN CONSIDERATIONS
SCHEMA OPTIMIZATION – NORMALIZATION
• Normalized data is non-redundant
(Text book says this is the best option)
• Reality introduces de-normalization
Welcome to Summary and Cache Tables
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 14
41. CODE EXAMPLES – SUMMARY TABLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 15
mysql> CREATE TABLE msg_per_hr (
hr DATETIME NOT NULL,
cnt INT UNSIGNED NOT NULL,
PRIMARY KEY(hr)
);
mysql> SELECT SUM(cnt) FROM msg_per_hr stored 23
hour
WHERE hr BETWEEN CONCAT(LEFT(NOW(), 14), '00:00') - INTERVAL 23 HOUR concat rounds
to nearest hr.
AND CONCAT(LEFT(NOW(), 14), '00:00') - INTERVAL 1 HOUR;
mysql> SELECT COUNT(*) FROM message first hour
WHERE posted >= NOW() - INTERVAL 24 HOUR
AND posted < CONCAT(LEFT(NOW(), 14), '00:00') - INTERVAL 23 HOUR;
mysql> SELECT COUNT(*) FROM message last hour
WHERE posted >= CONCAT(LEFT(NOW(), 14), '00:00');
42. CODE EXAMPLES – CACHE TABLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 16
mysql> DROP TABLE IF EXISTS my_cache_new, my_cache_old;
mysql> CREATE TABLE my_cache_new LIKE my_cache;
-- populate my_cache_new as desired
mysql> RENAME TABLE my_cache TO my_cache_old, my_cache_new TO my_cache;
43. CODE EXAMPLES – COUNTER TABLE
CONCURRENCY ISSUE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 17
mysql> CREATE TABLE hit_counter (
cnt INT UNSIGNED NOT NULL
) ENGINE=InnoDB;
mysql> UPDATE hit_counter SET cnt = cnt + 1;
mysql> SELECT cnt FROM hit_counter;
44. CODE EXAMPLES – COUNTER TABLE
CONCURRENCY SOLUTION
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 18
mysql> CREATE TABLE hit_counter (
slot TINYINT UNSIGNED NOT NULL PRIMARY KEY,
cnt INT UNSIGNED NOT NULL
) ENGINE=InnoDB;
mysql> INSERT INTO hit_counter VALUES
(0,0),
(1,0),
(2,0),
(3,0),
…
(99,0);
mysql> UPDATE hit_counter SET cnt = cnt + 1 WHERE slot = RAND() * 100;
mysql> SELECT SUM(cnt) FROM hit_counter;
47. INDEXING
HASH INDEX
• InnoDB creates adaptive hash indexes on frequent queries
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 20
48. INDEXING
HASH INDEX
• InnoDB creates adaptive hash indexes on frequent queries
• Main downside is that index doesn’t help sorting
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 20
49. INDEXING
HASH INDEX
• InnoDB creates adaptive hash indexes on frequent queries
• Main downside is that index doesn’t help sorting
• Hash indexes can’t speed up range queries (WHERE age > 18)
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 20
50. INDEXING
HASH INDEX – HOW TO – INCLUDING HASH
COLLISION
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 21
mysql> SELECT id FROM url WHERE url="http://www.joomladagen.nl";
CREATE TABLE pseudohash (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
url VARCHAR(255) NOT NULL,
url_crc INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY(id)
);
CREATE TRIGGER pseudohash_crc_ins BEFORE INSERT ON pseudohash FOR EACH ROW BEGIN
SET NEW.url_crc=crc32(NEW.url);
CREATE TRIGGER pseudohash_crc_upd BEFORE UPDATE ON pseudohash FOR EACH ROW BEGIN
SET NEW.url_crc=crc32(NEW.url);
mysql> SELECT id FROM url WHERE url_crc=CRC32("http://www.joomladagen.nl") AND
url="http://www.joomladagen.nl";
51. INDEXING
INDEX PROBLEMS
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 22
SELECT * FROM Orgchart SELECT a, c FROM Orgchart SELECT a, c FROM Orgchart
WHERE lft - rgt = 1; WHERE lft - rgt = 1; WHERE lft =(rgt – 1);
SELECT name FROM people mysql> ALTER TABLE people ADD KEY (idx_name(6));
WHERE name = ‘Hans’;
CREATE TABLE t ( KEY(c1,c2,c3) ? KEY(c1,c3) Specificity!
c1 INT,
c2 INT,
c3 INT,
KEY(c1),
KEY(c2),
KEY(c3)
);
52. INDEXING
INDEX PROBLEMS
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 22
SELECT * FROM Orgchart SELECT a, c FROM Orgchart SELECT a, c FROM Orgchart
WHERE lft - rgt = 1; WHERE lft - rgt = 1; WHERE lft =(rgt – 1);
SELECT name FROM people mysql> ALTER TABLE people ADD KEY (idx_name(6));
WHERE name = ‘Hans’;
CREATE TABLE t ( KEY(c1,c2,c3) ? KEY(c1,c3) Specificity!
c1 INT,
c2 INT,
c3 INT,
KEY(c1),
KEY(c2),
KEY(c3)
);
SELECT cc FROM payment WHERE staff_id = 2 AND customer_id =
584;
53. INDEXING
INDEX PROBLEMS
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 22
SELECT * FROM Orgchart SELECT a, c FROM Orgchart SELECT a, c FROM Orgchart
WHERE lft - rgt = 1; WHERE lft - rgt = 1; WHERE lft =(rgt – 1);
SELECT name FROM people mysql> ALTER TABLE people ADD KEY (idx_name(6));
WHERE name = ‘Hans’;
CREATE TABLE t ( KEY(c1,c2,c3) ? KEY(c1,c3) Specificity!
c1 INT,
c2 INT,
c3 INT,
KEY(c1),
KEY(c2),
KEY(c3)
);
SELECT cc FROM payment WHERE staff_id = 2 AND customer_id =
584;
KEY(staff_id,customer_id) ?
54. INDEXING
INDEX PROBLEMS
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 22
SELECT * FROM Orgchart SELECT a, c FROM Orgchart SELECT a, c FROM Orgchart
WHERE lft - rgt = 1; WHERE lft - rgt = 1; WHERE lft =(rgt – 1);
SELECT name FROM people mysql> ALTER TABLE people ADD KEY (idx_name(6));
WHERE name = ‘Hans’;
CREATE TABLE t ( KEY(c1,c2,c3) ? KEY(c1,c3) Specificity!
c1 INT,
c2 INT,
c3 INT,
KEY(c1),
KEY(c2),
KEY(c3)
);
SELECT cc FROM payment WHERE staff_id = 2 AND customer_id =
584;
KEY(staff_id,customer_id) ?
SELECT SUM(staff_id = 2), SUM(customer_id = 584) FROM
paymentG
*************************** 1. row ***************************
SUM(staff_id = 2): 7992
SUM(customer_id = 584): 30
55. INDEXING
INDEX PROBLEMS
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 22
SELECT * FROM Orgchart SELECT a, c FROM Orgchart SELECT a, c FROM Orgchart
WHERE lft - rgt = 1; WHERE lft - rgt = 1; WHERE lft =(rgt – 1);
SELECT name FROM people mysql> ALTER TABLE people ADD KEY (idx_name(6));
WHERE name = ‘Hans’;
CREATE TABLE t ( KEY(c1,c2,c3) ? KEY(c1,c3) Specificity!
c1 INT,
c2 INT,
c3 INT,
KEY(c1),
KEY(c2),
KEY(c3)
);
SELECT cc FROM payment WHERE staff_id = 2 AND customer_id =
584;
KEY(staff_id,customer_id) ?
SELECT SUM(staff_id = 2), SUM(customer_id = 584) FROM
paymentG
*************************** 1. row ***************************
SUM(staff_id = 2): 7992
SUM(customer_id = 584): 30
ALTER TABLE payment ADD KEY(customer_id, staff_id);
56. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
57. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
WHERE age BETWEEN 18 AND 25
ORDER BY rating ASC
58. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
WHERE age BETWEEN 18 AND 25
ORDER BY rating ASC
MySQL can’t use added index if
primary index uses range criterion
59. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
WHERE age BETWEEN 18 AND 25
ORDER BY rating ASC
MySQL can’t use added index if
primary index uses range criterion
KEY(sex, country)
60. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
WHERE age BETWEEN 18 AND 25
ORDER BY rating ASC
MySQL can’t use added index if
primary index uses range criterion
KEY(sex, country)
NO Selectivity!!!
61. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
WHERE age BETWEEN 18 AND 25
ORDER BY rating ASC
MySQL can’t use added index if
primary index uses range criterion
KEY(sex, country)
NO Selectivity!!!
KEY(sex, country)
Assumption: all searches will include sex
and most will include country
62. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 23
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
WHERE age BETWEEN 18 AND 25
ORDER BY rating ASC
MySQL can’t use added index if
primary index uses range criterion
KEY(sex, country)
NO Selectivity!!!
KEY(sex, country)
Assumption: all searches will include sex
and most will include country
Trick: AND sex IN('m', 'f')
63. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 24
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
64. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 24
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
(sex, country, age)
(sex, country, region, age)
(sex, country, region, city, age)
65. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 24
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
(sex, country, age)
(sex, country, region, age)
(sex, country, region, city, age)
Using the IN() trick, we can implement
just the
(sex, country, region, city, age) index.
66. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 24
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
(sex, country, age)
(sex, country, region, age)
(sex, country, region, city, age)
Using the IN() trick, we can implement
just the
(sex, country, region, city, age) index.
Why is age at end?
67. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 24
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
(sex, country, age)
(sex, country, region, age)
(sex, country, region, city, age)
Using the IN() trick, we can implement
just the
(sex, country, region, city, age) index.
Why is age at end?
Remember our range problem?
MySQL uses indexes from left to right
unit the first range query
Trick: Convert WHERE age BETWEEN 18 and 25
to
WHERE age IN(18,19,20,21,22,23,24,25)
68. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 25
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
SELECT age, country, …. , name FROM profiles
WHERE sex=‘F‘
ORDER BY rating
LIMIT 100000, 10;
Retrieving 100’010 rows, discarding
100’000
If data load per row is 15kb calculated data is
18.32Mb and we’re discarding 18.31Mb!
SELECT age, country, …. , name FROM profiles
INNER JOIN (
SELECT id FROM profiles
WHERE x.sex='M‘
ORDER BY rating LIMIT 100000, 10
) AS x
USING(id);
69. INDEXING
EXAMPLE
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 25
CREATE TABLE profile(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
sex CHAR(1) NOT NULL,
age TINYINT NOT NULL,
country VARCHAR(255) NOT NULL,
region VARCHAR(255) NOT NULL DEFAULT ‘’,
city VARCHAR(255) NOT NULL DEFAULT ‘’,
color_hair VARCHAR(255) NOT NULL DEFAULT ‘’,
color_eyes VARCHAR(255) NOT NULL DEFAULT ‘’,
name
…
…
rating TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY(id)
);
KEY(sex, rating)
SELECT age, country, …. , name FROM profiles
WHERE sex=‘F‘
ORDER BY rating
LIMIT 100000, 10;
Retrieving 100’010 rows, discarding
100’000
If data load per row is 15kb calculated data is
18.32Mb and we’re discarding 18.31Mb!
SELECT age, country, …. , name FROM profiles
INNER JOIN (
SELECT id FROM profiles
WHERE x.sex='M‘
ORDER BY rating LIMIT 100000, 10
) AS x
USING(id);
71. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
72. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
73. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
74. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
All I want is the ingredients for a Stroopwafel
This Query returns all columns for all three tables!
75. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
All I want is the ingredients for a Stroopwafel
This Query returns all columns for all three tables!
SELECT recipes.ingredient.* FROM recipes.ingredient
...
;
76. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
All I want is the ingredients for a Stroopwafel
This Query returns all columns for all three tables!
SELECT recipes.ingredient.* FROM recipes.ingredient
...
;
77. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
All I want is the ingredients for a Stroopwafel
This Query returns all columns for all three tables!
SELECT recipes.ingredient.* FROM recipes.ingredient
...
;
SELECT img, name, …, comment FROM
comments
WHERE user_id = 123983;
78. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
All I want is the ingredients for a Stroopwafel
This Query returns all columns for all three tables!
SELECT recipes.ingredient.* FROM recipes.ingredient
...
;
SELECT img, name, …, comment FROM
comments
WHERE user_id = 123983;
What, did the image and name change
in the last 2microseconds?!?
79. QUERY OPTIMIZATION
TOO MUCH DATA
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 27
SELECT * FROM Orgchart
WHERE lft - rgt = 1;
SELECT * FROM recipes.ingredient
INNER JOIN recipes.recipe_ingredient
USING(ingredient_id)
INNER JOIN recipes.recipe USING(recipe_id)
WHERE recipes.recipe.name = ‘Stroopwafel';
All I want is the ingredients for a Stroopwafel
This Query returns all columns for all three tables!
SELECT recipes.ingredient.* FROM recipes.ingredient
...
;
SELECT img, name, …, comment FROM
comments
WHERE user_id = 123983;
What, did the image and name change
in the last 2microseconds?!?
SELECT img, name, …, FROM comments
WHERE user_id = 123983;
SELECT comment FROM comments
WHERE user_id = 123983;
81. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 28
DELETE FROM messages
WHERE created < DATE_SUB(NOW(),INTERVAL 3 MONTH);
82. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 28
DELETE FROM messages
WHERE created < DATE_SUB(NOW(),INTERVAL 3 MONTH);
<?php
…
$rows_affected = 0;
do {
$rows_affected = do_query("
DELETE FROM messages
WHERE created < DATE_SUB(NOW(),INTERVAL 3 MONTH)
LIMIT 10000
");
} while $rows_affected > 0;
84. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
85. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
SELECT * FROM tag WHERE tag='joomladagen';
SELECT * FROM tag_post WHERE tag_id=1234;
SELECT * FROM post WHERE post.id IN(123,456,567,9098,8904);
86. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
SELECT * FROM tag WHERE tag='joomladagen';
SELECT * FROM tag_post WHERE tag_id=1234;
SELECT * FROM post WHERE post.id IN(123,456,567,9098,8904);
WHY? DENORMALIZED ?!?
87. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
SELECT * FROM tag WHERE tag='joomladagen';
SELECT * FROM tag_post WHERE tag_id=1234;
SELECT * FROM post WHERE post.id IN(123,456,567,9098,8904);
WHY? DENORMALIZED ?!?
• Query cache validation of 3 tables instead of one
88. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
SELECT * FROM tag WHERE tag='joomladagen';
SELECT * FROM tag_post WHERE tag_id=1234;
SELECT * FROM post WHERE post.id IN(123,456,567,9098,8904);
WHY? DENORMALIZED ?!?
• Query cache validation of 3 tables instead of one
• Lock contention (?)
89. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
SELECT * FROM tag WHERE tag='joomladagen';
SELECT * FROM tag_post WHERE tag_id=1234;
SELECT * FROM post WHERE post.id IN(123,456,567,9098,8904);
WHY? DENORMALIZED ?!?
• Query cache validation of 3 tables instead of one
• Lock contention (?)
• Query index lookup of IN() is better than with JOINS
90. QUERY OPTIMIZATION
DIVIDE AND CONQUER
JOOMLADAY NETHERLANDS 2013 - ELI ASCHKENASY - @ELIASCHKENASY 29
SELECT * FROM tag
JOIN tag_post ON tag_post.tag_id=tag.id
JOIN post ON tag_post.post_id=post.id
WHERE tag.tag=‘joomladagen';
SELECT * FROM tag WHERE tag='joomladagen';
SELECT * FROM tag_post WHERE tag_id=1234;
SELECT * FROM post WHERE post.id IN(123,456,567,9098,8904);
WHY? DENORMALIZED ?!?
• Query cache validation of 3 tables instead of one
• Lock contention (?)
• Query index lookup of IN() is better than with JOINS
• Potential for application caching