This document is a presentation about creative programming with MySQL. It discusses various MySQL features like stored routines, triggers, views, events, federated and blackhole storage engines, and loops. It presents some hacks and creative uses of these features, such as using triggers with federated and blackhole tables to enable remote execution and cascading triggers. The goal is to show programmers ways to overcome limitations and bring more logic into the database layer rather than just the application layer.
MySql Triggers Tutorial - The Webs Academythewebsacademy
A SQL trigger is a set of SQL statements stored in the database catalog. A SQL trigger is executed or fired whenever an event associated with a table occurs e.g., insert, update or delete.
here you will get basic idea about TERMINAL. you learn some basic commands. with the help of that commands you can make new folder(directory), new file with .txt or any other extension.you will learn HOW to make multiple folder in just one second. you will find Important information about the Linux terminal.
MySql Triggers Tutorial - The Webs Academythewebsacademy
A SQL trigger is a set of SQL statements stored in the database catalog. A SQL trigger is executed or fired whenever an event associated with a table occurs e.g., insert, update or delete.
here you will get basic idea about TERMINAL. you learn some basic commands. with the help of that commands you can make new folder(directory), new file with .txt or any other extension.you will learn HOW to make multiple folder in just one second. you will find Important information about the Linux terminal.
Digital transformation is more than a buzz phrase. Learn how companies are evolving to Cloud, systematically leveraging existing workloads on their current platforms for competitive advantage. This session explores the transition to Cloud using Node.js technologies and unlocking the power of your existing data sets and what you can expect from the Node.js Foundation and community moving forward. See how the ability to start on known and familiar platforms and environments and to maintain a bridge to data on these platforms using new technologies like Node.js can be one of the keys to success of the move to cloud native.
Come learn about the work IBM is doing to ensure to that:
- Node.js is available across platforms and environments
- that key tools and capabilities are available (monitoring, post mortem investigation)
- you can leverage existing datasets in your cloud native applications using the IBM SDK for Node.js is based on the Node.js™ open source project. It provides a compatible solution for IBM Power™, Intel® and z Systems™ products that require Node.js functionality and package management.
This CommunityOne session covers global issues of relevance to all JUGs. In particular, it focuses on the current JUG leadership community and JUG resources associated with the java.net site: the JUGs Community, JUG leaders mailing list, JUGs international map, the Footprint Project, and the like. For its local action focus, it addresses pragmatic issues related to starting new JUGs and sustaining existing ones over the long term. After some initial dialogue among the panelists on these global and local concerns, the panel will open the floor to questions from the audience.
Gerrit Analytics applied to Android source codeLuca Milanesio
GerritForge trialled the Gerrit Analytics plugin and ETL with the Android Open-Source Project code-base. The results of the trial have been presented at the Gerrit User Summit 2019 at Gothenburg and Sunnyvale CA. Find inside an overview of the problems involved, the solutions implemented and also the use of the pull-replication plugin to fetch the code from the official Android repository.
Legacy Renewal of Central Framework in the EnterpriseAnatole Tresch
Speak done at GeeCon and other Conferences in 2014 showing an experience report of some of the complexities to be faced when changing commonly used frameworks and runtime components in Credit Suisse and how issues were solved finally.
High Performance Php My Sql Scaling TechniquesZendCon
This talk will discuss issues and solutions when attempting to scale PHP and MySQL to high volume websites (such as digg.com). It will discuss some of the problems at hand, and go into (at a high level) some of the solutions, such as using memcache, DB partitioning, etc. As well as how to handle these solutions within PHP.
Presentation by IBM's Martin Nally and Mike O'Rourke from Innovate 2010, including discussion on tool integration challenges and IBM's two pronged approach for addressing (OSLC - open linked lifecycle data, Jazz - alm services platform).
Recover 30% of your day with IBM Development Tools (Smarter Mainframe Develop...Susan Yoskin
If you need to attract new developers, and want to keep your company’s name out of the headlines, then this session is for you. When your business depends on your mainframe apps working and performing well—all the time—you need to be alerted to issues as they occur and have the tools to help you find and fix the problems and test your solutions before disaster strikes (we’ve all been in those late night and weekend drills). You also need to continue supporting these applications for years to come, and that will require new talent.
This session will introduce you to the development environments that college grads are already comfortable with, and help your applications become more resilient at the same time. We’ll walk you through the tools to help you accomplish all of this and demo some scenarios to show you how efficiently our tools can perform the tasks that slow you down.
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
On November 27 Trayan Iliev from IPT presented “Reactive microservices with Spring 5: WebFlux” @Dev.bg in Betahaus Sofia. IPT – Intellectual Products & Technologies has been organizing Java & JavaScript trainings since 2003.
Spring 5 introduces a new model for end-to-end functional and reactive web service programming with Spring 5 WebFlow, Spring Data & Spring Boot. The main topics include:
– Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure)
– REST services with WebFlux – comparison between annotation-based and functional reactive programming approaches for building.
– Router, handler and filter functions
– Using reactive repositories and reactive database access with Spring Data. Building end-to-end non-blocking reactive web services using Netty-based web runtime
– Reactive WebClients and integration testing. Reactive WebSocket support
– Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
A/B Linux updates with RAUC and meta-rauc-community: now & in the futureLeon Anavi
RAUC is a safe and secure open source software solution for A/B updates of embedded Linux devices. It supports the Yocto Project and OpenEmbedded, Buildroot and PTXdist. Upgrades are performed through RAUC bundles which can be installed either through the network or using the old-fashioned way with a USB stick.
In 2020 layer meta-rauc-community was created to provide examples how to integrate the lightweight update client RAUC on various machines. Initially it supported Raspberry Pi. In 2021 the layer was moved to the RAUC organization in GitHub and over the time it was ported to new machine, including qemux86-64, sunxi (Allwinner) and NVIDIA Jetson TX2.
The presentation is appropriate for anyone interested in software upgrades. We will talk about the evolution of meta-rauc-community and provide guidelines for porting to new machines using Yocto and OpenEmbedded BSP layers.
Nagios Conference 2011 - Larry Adams - 10 Years Of CactiNagios
Larry Adam's presentation on Cacti. The presentation was given during the Nagios World Conference North America held Sept 27-29th, 2011 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna
Digital transformation is more than a buzz phrase. Learn how companies are evolving to Cloud, systematically leveraging existing workloads on their current platforms for competitive advantage. This session explores the transition to Cloud using Node.js technologies and unlocking the power of your existing data sets and what you can expect from the Node.js Foundation and community moving forward. See how the ability to start on known and familiar platforms and environments and to maintain a bridge to data on these platforms using new technologies like Node.js can be one of the keys to success of the move to cloud native.
Come learn about the work IBM is doing to ensure to that:
- Node.js is available across platforms and environments
- that key tools and capabilities are available (monitoring, post mortem investigation)
- you can leverage existing datasets in your cloud native applications using the IBM SDK for Node.js is based on the Node.js™ open source project. It provides a compatible solution for IBM Power™, Intel® and z Systems™ products that require Node.js functionality and package management.
This CommunityOne session covers global issues of relevance to all JUGs. In particular, it focuses on the current JUG leadership community and JUG resources associated with the java.net site: the JUGs Community, JUG leaders mailing list, JUGs international map, the Footprint Project, and the like. For its local action focus, it addresses pragmatic issues related to starting new JUGs and sustaining existing ones over the long term. After some initial dialogue among the panelists on these global and local concerns, the panel will open the floor to questions from the audience.
Gerrit Analytics applied to Android source codeLuca Milanesio
GerritForge trialled the Gerrit Analytics plugin and ETL with the Android Open-Source Project code-base. The results of the trial have been presented at the Gerrit User Summit 2019 at Gothenburg and Sunnyvale CA. Find inside an overview of the problems involved, the solutions implemented and also the use of the pull-replication plugin to fetch the code from the official Android repository.
Legacy Renewal of Central Framework in the EnterpriseAnatole Tresch
Speak done at GeeCon and other Conferences in 2014 showing an experience report of some of the complexities to be faced when changing commonly used frameworks and runtime components in Credit Suisse and how issues were solved finally.
High Performance Php My Sql Scaling TechniquesZendCon
This talk will discuss issues and solutions when attempting to scale PHP and MySQL to high volume websites (such as digg.com). It will discuss some of the problems at hand, and go into (at a high level) some of the solutions, such as using memcache, DB partitioning, etc. As well as how to handle these solutions within PHP.
Presentation by IBM's Martin Nally and Mike O'Rourke from Innovate 2010, including discussion on tool integration challenges and IBM's two pronged approach for addressing (OSLC - open linked lifecycle data, Jazz - alm services platform).
Recover 30% of your day with IBM Development Tools (Smarter Mainframe Develop...Susan Yoskin
If you need to attract new developers, and want to keep your company’s name out of the headlines, then this session is for you. When your business depends on your mainframe apps working and performing well—all the time—you need to be alerted to issues as they occur and have the tools to help you find and fix the problems and test your solutions before disaster strikes (we’ve all been in those late night and weekend drills). You also need to continue supporting these applications for years to come, and that will require new talent.
This session will introduce you to the development environments that college grads are already comfortable with, and help your applications become more resilient at the same time. We’ll walk you through the tools to help you accomplish all of this and demo some scenarios to show you how efficiently our tools can perform the tasks that slow you down.
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
On November 27 Trayan Iliev from IPT presented “Reactive microservices with Spring 5: WebFlux” @Dev.bg in Betahaus Sofia. IPT – Intellectual Products & Technologies has been organizing Java & JavaScript trainings since 2003.
Spring 5 introduces a new model for end-to-end functional and reactive web service programming with Spring 5 WebFlow, Spring Data & Spring Boot. The main topics include:
– Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure)
– REST services with WebFlux – comparison between annotation-based and functional reactive programming approaches for building.
– Router, handler and filter functions
– Using reactive repositories and reactive database access with Spring Data. Building end-to-end non-blocking reactive web services using Netty-based web runtime
– Reactive WebClients and integration testing. Reactive WebSocket support
– Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
A/B Linux updates with RAUC and meta-rauc-community: now & in the futureLeon Anavi
RAUC is a safe and secure open source software solution for A/B updates of embedded Linux devices. It supports the Yocto Project and OpenEmbedded, Buildroot and PTXdist. Upgrades are performed through RAUC bundles which can be installed either through the network or using the old-fashioned way with a USB stick.
In 2020 layer meta-rauc-community was created to provide examples how to integrate the lightweight update client RAUC on various machines. Initially it supported Raspberry Pi. In 2021 the layer was moved to the RAUC organization in GitHub and over the time it was ported to new machine, including qemux86-64, sunxi (Allwinner) and NVIDIA Jetson TX2.
The presentation is appropriate for anyone interested in software upgrades. We will talk about the evolution of meta-rauc-community and provide guidelines for porting to new machines using Yocto and OpenEmbedded BSP layers.
Nagios Conference 2011 - Larry Adams - 10 Years Of CactiNagios
Larry Adam's presentation on Cacti. The presentation was given during the Nagios World Conference North America held Sept 27-29th, 2011 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Assure Contact Center Experiences for Your Customers With ThousandEyes
MySQL creative programming
1. Creative programming with MySQL
Giuseppe Maxia,
MySQL Community Team Lead
Database Group,
Sun Microsystems Inc
giuseppe.maxia@sun.com The Data Charmer
6. About me
22 years in IT
consultant
MySQL community
QA developer
MySQL Community Team Lead
2008 CommunityOne Conference | developers.sun.com/events/communityone | 3
7. About me
database hacker
creative programmer
2008 CommunityOne Conference | developers.sun.com/events/communityone | 4
8. Does it look familiar?
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
9. Does it look familiar?
SELECT * FROM table_name;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
10. Does it look familiar?
SELECT * FROM table_name;
UPDATE table_name SET x=1 WHERE
y=10;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
11. Does it look familiar?
SELECT * FROM table_name;
UPDATE table_name SET x=1 WHERE
y=10;
DELETE FROM tab_name WHERE z=1;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
12. Does it look familiar?
SELECT * FROM table_name;
UPDATE table_name SET x=1 WHERE
y=10;
DELETE FROM tab_name WHERE z=1;
make coffee;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
13. Does it look familiar?
SELECT * FROM table_name;
UPDATE table_name SET x=1 WHERE
y=10;
DELETE FROM tab_name WHERE z=1;
make coffee;
play movie;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
14. Does it look familiar?
SELECT * FROM table_name;
UPDATE table_name SET x=1 WHERE
y=10;
DELETE FROM tab_name WHERE z=1;
make coffee;
??
play movie;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 5
19. What average programmers dislike
regular expressions
2008 CommunityOne Conference | developers.sun.com/events/communityone | 8
20. What average programmers dislike
regular expressions
quot;I (love|hate)s*([Ff]w*)s*REGEXPquot;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 8
21. What average programmers dislike
regular expressions
database backend
2008 CommunityOne Conference | developers.sun.com/events/communityone | 9
22. What average programmers dislike
regular expressions
database backend
SELECT t.id
FROM (SELECT id2 FROM other
WHERE b = 2) AS t
WHERE a > (SELECT MAX(x) FROM z);
2008 CommunityOne Conference | developers.sun.com/events/communityone | 9
23. Why many programmers hate database
handling?
SQL != Java
SQL != Perl
SQL != PHP
SQL != C++
I want to write in my language of choice
2008 CommunityOne Conference | developers.sun.com/events/communityone | 10
24. database handling
bring the
logic at
application
level
2008 CommunityOne Conference | developers.sun.com/events/communityone | 11
32. Stored routines - the boring stu
SQL standard
heavy syntax
tricky performance
no debug - limited exception handling
procedures
• can return multiple record sets
• can execute dynamic code
functions
• must return one value
• no dynamic code
2008 CommunityOne Conference | developers.sun.com/events/communityone | 19
33. Stored routines - the boring stu
SQL statements
IF THEN ELSE .. END IF
WHILE .. DO .. END WHILE
LOOP .. END LOOP
CURSOR
CONDITION
HANDLER
2008 CommunityOne Conference | developers.sun.com/events/communityone | 20
34. Stored routines - some hacks
enhance the language
• arrays
• easy loops
• global variables
• see MySQL general purpose routine library
create routines on-the-fly
• undocumented hack!
• see http://datacharmer.org
2008 CommunityOne Conference | developers.sun.com/events/communityone | 21
36. Triggers - the boring stu
BEFORE or AFTER event
BEFORE INSERT/UPDATE/DELETE
AFTER INSERT/UPDATE/DELETE
No dynamic code
No operations on the same table
No multiple triggers per event
2008 CommunityOne Conference | developers.sun.com/events/communityone | 23
37. Triggers - what for
dedicated logging
data aggregation
transfer of data to other tables/databases
calculated fields
2008 CommunityOne Conference | developers.sun.com/events/communityone | 24
38. Triggers - HACKS!
wait.
Strong combination with FEDERATED and
BLACKHOLE
2008 CommunityOne Conference | developers.sun.com/events/communityone | 25
40. Views
no storage
look like tables
can aggregate data
can insert data
can save time
but can also become horribly ineficient
2008 CommunityOne Conference | developers.sun.com/events/communityone | 27
41. Views - the cool stu
can run functions
can create sort of triggers on select
2008 CommunityOne Conference | developers.sun.com/events/communityone | 28
42. Views with functions
CREATE FUNCTION f(V VARCHAR(20))
RETURNS INT
BEGIN
INSERT INTO log_table
VALUES (V, NOW());
RETURN 1;
END
2008 CommunityOne Conference | developers.sun.com/events/communityone | 29
43. Views with functions
CREATE VIEW v1 AS
SELECT x FROM table_name
WHERE f('v1') = 1;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 30
45. Events - the not-so-boring facts
Temporal triggers
Operating System independent
executes SQL command or routine
• AT timestamp
• EVERY X time_interval
can execute dynamic SQL
2008 CommunityOne Conference | developers.sun.com/events/communityone | 32
46. Events
CREATE EVENT e1
ON SCHEDULE
AT NOW() + INTERVAL 10 minute
DO
CALL clean_employee_recs();
2008 CommunityOne Conference | developers.sun.com/events/communityone | 33
47. Events
CREATE EVENT e1
ON SCHEDULE
EVERY 5 minute
DO
CALL import_recs_from_file();
2008 CommunityOne Conference | developers.sun.com/events/communityone | 34
49. Federated storage engine
no storage
connects to a table on a remote server
since version 5.1.22 can connect to a table on the
same server
table t1f table t1
federated MyISAM
2008 CommunityOne Conference | developers.sun.com/events/communityone | 36
51. Federated storage engine
limited pushdown conditions
federated
table base
table
SELECT ID
FROM table_name
SELECT ID
WHERE x = 10
FROM table_name
expected
returns
~ 100 records filter 1 million records
2008 CommunityOne Conference | developers.sun.com/events/communityone | 38
52. Federated storage engine
workaround pushdown conditions
add fake index
on column x
federated
to Federated table
table base
table
SELECT ID
FROM table_name
SELECT ID
WHERE x = 10
FROM table_name
WHERE x = 10
expected
returns
~ 100 records
100 records
2008 CommunityOne Conference | developers.sun.com/events/communityone | 39
54. Blackhole
The NON-STORAGE engine
like /dev/null in Unix
used for triggers and replication relay
record
record binary log
record
record
triggers
2008 CommunityOne Conference | developers.sun.com/events/communityone | 41
56. More exciting triggers
Put them together
• triggers
• Federated engine
• Blackhole engine
2008 CommunityOne Conference | developers.sun.com/events/communityone | 43
57. cascade triggers
BASE TABLE
before insert
after insert
before update
after update
before delete
after delete
t1
2008 CommunityOne Conference | developers.sun.com/events/communityone | 44
58. cascade triggers
Federated
BASE TABLE
TABLE
before insert
before insert
after insert
after insert
before update before update
after update after update
before delete before delete
after delete after delete
t1 t1_f1
2008 CommunityOne Conference | developers.sun.com/events/communityone | 44
59. triggers on request Federated before insert
TABLE
either
BASE TABLE after update
t1_f1
after delete
Federated before insert
TABLE after insert
or before update
t1
before delete
t1_f2
2008 CommunityOne Conference | developers.sun.com/events/communityone | 45
60. blackhole triggers
BASE TABLE
blackhole
TABLE
before insert
t1
BASE TABLE
t1_b1
t2
2008 CommunityOne Conference | developers.sun.com/events/communityone | 46
64. loops
or why do we have to endure this?
loops with CURSORS
• dreadful syntax
• INEFFICIENT (temporary table created)
loops alternatives ... coming soon
2008 CommunityOne Conference | developers.sun.com/events/communityone | 50
65. loops with cursors :(
data to crc flag
process cursor
temporary
loop
table
handler
crc
2008 CommunityOne Conference | developers.sun.com/events/communityone | 51
66. loops with cursors (I) :(
CREATE PROCEDURE p(j INT)
BEGIN
DECLARE done BOOLEAN default 'false';
DECLARE crc VARCHAR(42) default '';
DECLARE cid INT;
DECLARE x CURSOR FOR
SELECT id FROM
table_name WHERE
b j;
-- to be continued
2008 CommunityOne Conference | developers.sun.com/events/communityone | 52
67. loops with cursors (II) :((
DECLARE CONTINUE HANDLER
FOR NOT FOUND set done = true;
OPEN CURSOR x;
search: LOOP
FETCH x into cid;
IF done THEN
LEAVE search;
END IF;
-- do something with cid
SET crc = MD5(CONCAT(crc,cid))
END LOOP;
SELECT crc;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 53
68. loops with blackhole :)
data to
crc
process
blackhole
table
crc
2008 CommunityOne Conference | developers.sun.com/events/communityone | 54
69. loops with blackhole (I) :)
CREATE TABLE t1 (
id VARCHAR(200)
) ENGINE = BLACKHOLE;
SET @crc = '';
SET @j = 10;
2008 CommunityOne Conference | developers.sun.com/events/communityone | 55
70. loops with blackhole (II) :)
INSERT INTO t1
SELECT @crc :=
MD5(CONCAT(@crc, id))
FROM table_name
WHERE b @j;
SELECT @crc;
IT'S FASTER!!!
2008 CommunityOne Conference | developers.sun.com/events/communityone | 56
71. more loops alternatives
use the General Purpose Routine Library
• https://sourceforge.net/projects/mysql-sr-lib/
use events!
(ON SCHEDULE EVERY 1 SECOND
ENDS NOW() + INTERVAL 10 SECOND)
use MySQL Proxy (later)
2008 CommunityOne Conference | developers.sun.com/events/communityone | 57
81. MySQL Proxy principles - hooks
PROXY
CORE Lua script
function
connection function
function
hook
read query function
hook
read result function
hook
2008 CommunityOne Conference | developers.sun.com/events/communityone | 65
82. MySQL Proxy principles - hooks
PROXY
CORE Lua script
function
connection function
function
hook
read query function
hook
read result function
hook
2008 CommunityOne Conference | developers.sun.com/events/communityone | 65
85. MySQL Proxy principles - Lua
• SMALL ( 200 KB)
• DESIGNED for
EMBEDDED systems
• Widely used (lighttpd)
2008 CommunityOne Conference | developers.sun.com/events/communityone | 67
86. MySQL Proxy principles - Lua
• SMALL ( 200 KB)
• DESIGNED for
EMBEDDED systems
• Widely used (lighttpd)
lighttpd, like MySQL
Proxy, was created by
Jan Kneschke
2008 CommunityOne Conference | developers.sun.com/events/communityone | 67
87. MySQL Proxy principles - Lua
Very popular among
game writers
2008 CommunityOne Conference | developers.sun.com/events/communityone | 68
88. MySQL Proxy principles - Lua
Very popular among
game writers
2008 CommunityOne Conference | developers.sun.com/events/communityone | 68
89. MySQL Proxy principles - Lua
Very popular among
game writers
2008 CommunityOne Conference | developers.sun.com/events/communityone | 68
92. Debugging
server
proxy
client
diagnostics
text
2008 CommunityOne Conference | developers.sun.com/events/communityone | 71
93. Debugging scripts
server
proxy
proxy
diagnostics
text
client
diagnostics
text
2008 CommunityOne Conference | developers.sun.com/events/communityone | 72
94. Chained proxies - double features
server
proxy
proxy
pivot tables
client
loops
2008 CommunityOne Conference | developers.sun.com/events/communityone | 73
95. Testing - customized packages
server
proxy
client
e.g.
fake packets
connectors
2008 CommunityOne Conference | developers.sun.com/events/communityone | 74
96. MySQL Proxy - loops revisited
# get the script from MySQL Forge
# http://forge.mysql.com/tools/tool.php?id=96
mysql-proxy
--proxy-lua-script=loop.lua
2008 CommunityOne Conference | developers.sun.com/events/communityone | 75
97. MySQL Proxy - loops revisited
mysql -h 127.0.0.1 -P 4040
FOR VAR 1 3
CREATE TABLE t_$VAR (id int);
# creates t_1, t_2, t_3
2008 CommunityOne Conference | developers.sun.com/events/communityone | 76
98. MySQL Proxy - loops revisited
mysql -h 127.0.0.1 -P 4040
FOR VAR ( aa, bb cc)
CREATE TABLE t_$VAR (id int);
# creates t_aa, t_bb, t_cc
2008 CommunityOne Conference | developers.sun.com/events/communityone | 77
99. Summary
MySQL is open to development creativity
Know your bricks
• stored routines, triggers, views, events
• dynamic engines (Federated, Blackhole)
• MySQL Proxy
Put them together : be creative
2008 CommunityOne Conference | developers.sun.com/events/communityone | 78
100. For More Information
MySQL Forge ( http://forge.mysql.com )
my blog ( http://datacharmer.blogspot.com )
MySQL blogs ( http://planetmysql.org )
2008 CommunityOne Conference | developers.sun.com/events/communityone | 79