Detailed presentation devoted to new features of Firebird 2.1 by Vladislav Khorsun, core Firebird Developer. Main features are covered, including tips and tricks and often usage scenarios.
Understanding the lock manager internals via the fb_lock_print utility
This session will provide a short introduction to the Firebird lock manager and its usage patterns. It will describe how the lock manager can affect the performance of highly loaded systems and outlines the possible bottlenecks and other problems like unexpected lock-ups/freezes that may require special analysis. The structure of the lock table will also be explained.
It will also include a detailed description of the fb_lock_print utility and its usage that will enable the research of issues that are related to the lock manager. A few practical examples illustrating how to analyze the utility output will be provided. This session is mainly of interest to Classic Server users and DBAs.
Building Applications Using NoSQL Architectures on top of SQL Azure: How MSN ...DATAVERSITY
Building highly-available and highly-scalable applications are one of the main reasons for using NoSQL database systems and processing frameworks over traditional relational database systems. Relational database systems have taken notice and are increasingly moving forward to provide solutions for these class of applications.
In this presentation we will showcase how the Windows Gaming Experience is using SQL Server Azure to build a highly-available and highly-scalable application that is used to create new experiences for millions of casual gamers in the next version of the Bing search engine and integrate Microsoft games with social-networking sites. They employ several of the NoSQL architectural patterns such as sharding. We will be presenting the architecture, lessons learned and also provide an insight into how the SQL Server Azure service is evolving to support NoSQL application development patterns such as sharding and open schema support to make SQL Server Azure a Not Only SQL database engine.
Presentation by Bruce Campbell of Microsoft
Learn about a new capability in SQL Server 2008 R2, Parallel Data Warehouse, formerly known as Project Madison.
Understanding the lock manager internals via the fb_lock_print utility
This session will provide a short introduction to the Firebird lock manager and its usage patterns. It will describe how the lock manager can affect the performance of highly loaded systems and outlines the possible bottlenecks and other problems like unexpected lock-ups/freezes that may require special analysis. The structure of the lock table will also be explained.
It will also include a detailed description of the fb_lock_print utility and its usage that will enable the research of issues that are related to the lock manager. A few practical examples illustrating how to analyze the utility output will be provided. This session is mainly of interest to Classic Server users and DBAs.
Building Applications Using NoSQL Architectures on top of SQL Azure: How MSN ...DATAVERSITY
Building highly-available and highly-scalable applications are one of the main reasons for using NoSQL database systems and processing frameworks over traditional relational database systems. Relational database systems have taken notice and are increasingly moving forward to provide solutions for these class of applications.
In this presentation we will showcase how the Windows Gaming Experience is using SQL Server Azure to build a highly-available and highly-scalable application that is used to create new experiences for millions of casual gamers in the next version of the Bing search engine and integrate Microsoft games with social-networking sites. They employ several of the NoSQL architectural patterns such as sharding. We will be presenting the architecture, lessons learned and also provide an insight into how the SQL Server Azure service is evolving to support NoSQL application development patterns such as sharding and open schema support to make SQL Server Azure a Not Only SQL database engine.
Presentation by Bruce Campbell of Microsoft
Learn about a new capability in SQL Server 2008 R2, Parallel Data Warehouse, formerly known as Project Madison.
Securing Shared Workstations with Novell SecureLoginNovell
Kiosks are deployed in many industries, such as health care and manufacturing, to provide users with quick access to applications. But challenges often arise in these deployments when users don’t close applications or simply leave the kiosk without logging off, exposing sensitive data to unauthorized users.
This session will demonstrate the use of the Desktop Automation Services. We will show you how to build policy-based shared workstation protection at the workstation level, at the network level (using Novell Modular Authentication Service and eDirectory) and across Citrix sessions. We will also show you how to configure the policies to lock workstations when an authentication device is removed or when the user’s session has timed out.
Finally, you will see a real-world example of Desktop Automation Services working at Maine Medical Center.
This session will demonstrate how to secure these shared workstations using the the Desktop Automation Services (DAS) in Novell SecureLogin. Presenters will show how to build policy-based shared workstation protection at the workstation level, at the network level (using NMAS and requires eDirectory™) and across Citrix sessions. They’ll also show how to configure the policies to lock workstations when an authentication device is removed or when the user’s session has timed out.
Scaling with SQL Server and SQL Azure FederationsMichael Rys
Slides for my presentation at the Seattle Hadoop/NoSQL Meetup (http://www.meetup.com/Seattle-Hadoop-HBase-NoSQL-Meetup/events/40509972/).
These slides are based on this earlier presentation: http://www.slideshare.net/MichaelRys/scaling-with-sql-server-and-sql-azure-federations.
With Dell PCIe Express Flash SSDs, you can get powerful performance for your databases from using internal storage. In our tests, the Dell PowerEdge R820 with four Dell PCIe Express Flash SSDs was able to support a maximum of 2,592 TPS, equal to that of a database cached in memory, which performed 2,555 TPS with the same system load.
For critical database applications, the Dell PowerEdge R820 with Dell PCIe Express Flash SSDs can provide you the performance you need without the hassles of external storage with a large number of disks.
Best Practices for Administering Novell GroupWise 8Novell
Along with a host of new end-user features, Novell GroupWise 8 includes administrative updates to make it easier than ever to keep your system running reliably, safeguard your data and leverage your existing investments. This session will assist you in perfecting the administration of your GroupWise messaging environment. You'll learn how to optimize and manage agents and configuration settings to maximize your system stability and performance.
Introducing Novell Privileged User Manager and Securing Novell Open Enterpris...Novell
Come to this session and see how Novell Privileged User Manager can help your organization reduce the cost, complexity and risk associated with managing superusers across the enterprise. Find out how to rapidly deploy superuser management for Novell Open Enterprise Server 2. You will see a live demo of how Novell Privileged User Manager allows you to control what commands users are authorized to run, at what time and from what location.
The mighty cloud draws businesses and developers who seek its agility and productivity. But which type of cloud is best? We moved eBay Marketplace, a major eCommerce site, from a traditional infrastructure to a cloud model. We will present the strategic, technical and cost factors we weighed when deciding between cloud versus automation, and porting applications versus rewriting them. We will explain why we ended up with a hybrid: developing our own internal cloud while leveraging the massive infrastructure of public cloud providers.
Securing Shared Workstations with Novell SecureLoginNovell
Kiosks are deployed in many industries, such as health care and manufacturing, to provide users with quick access to applications. But challenges often arise in these deployments when users don’t close applications or simply leave the kiosk without logging off, exposing sensitive data to unauthorized users.
This session will demonstrate the use of the Desktop Automation Services. We will show you how to build policy-based shared workstation protection at the workstation level, at the network level (using Novell Modular Authentication Service and eDirectory) and across Citrix sessions. We will also show you how to configure the policies to lock workstations when an authentication device is removed or when the user’s session has timed out.
Finally, you will see a real-world example of Desktop Automation Services working at Maine Medical Center.
This session will demonstrate how to secure these shared workstations using the the Desktop Automation Services (DAS) in Novell SecureLogin. Presenters will show how to build policy-based shared workstation protection at the workstation level, at the network level (using NMAS and requires eDirectory™) and across Citrix sessions. They’ll also show how to configure the policies to lock workstations when an authentication device is removed or when the user’s session has timed out.
Scaling with SQL Server and SQL Azure FederationsMichael Rys
Slides for my presentation at the Seattle Hadoop/NoSQL Meetup (http://www.meetup.com/Seattle-Hadoop-HBase-NoSQL-Meetup/events/40509972/).
These slides are based on this earlier presentation: http://www.slideshare.net/MichaelRys/scaling-with-sql-server-and-sql-azure-federations.
With Dell PCIe Express Flash SSDs, you can get powerful performance for your databases from using internal storage. In our tests, the Dell PowerEdge R820 with four Dell PCIe Express Flash SSDs was able to support a maximum of 2,592 TPS, equal to that of a database cached in memory, which performed 2,555 TPS with the same system load.
For critical database applications, the Dell PowerEdge R820 with Dell PCIe Express Flash SSDs can provide you the performance you need without the hassles of external storage with a large number of disks.
Best Practices for Administering Novell GroupWise 8Novell
Along with a host of new end-user features, Novell GroupWise 8 includes administrative updates to make it easier than ever to keep your system running reliably, safeguard your data and leverage your existing investments. This session will assist you in perfecting the administration of your GroupWise messaging environment. You'll learn how to optimize and manage agents and configuration settings to maximize your system stability and performance.
Introducing Novell Privileged User Manager and Securing Novell Open Enterpris...Novell
Come to this session and see how Novell Privileged User Manager can help your organization reduce the cost, complexity and risk associated with managing superusers across the enterprise. Find out how to rapidly deploy superuser management for Novell Open Enterprise Server 2. You will see a live demo of how Novell Privileged User Manager allows you to control what commands users are authorized to run, at what time and from what location.
The mighty cloud draws businesses and developers who seek its agility and productivity. But which type of cloud is best? We moved eBay Marketplace, a major eCommerce site, from a traditional infrastructure to a cloud model. We will present the strategic, technical and cost factors we weighed when deciding between cloud versus automation, and porting applications versus rewriting them. We will explain why we ended up with a hybrid: developing our own internal cloud while leveraging the massive infrastructure of public cloud providers.
Windows Server 2012 vereinfacht die Einrichtung von Direct Access stark. Wie ist die Abgrenzung zum Forefront UAG, was sind die neuen Möglichkeiten und wie sieht DirectAccess in der Praxis aus? Nach dieser Session haben Sie DirectAccess live gesehen und können das Potenzial für Ihr Unternehmen einschätzen.
Smartsup is a system which tries to come up witha system connecting SugarCRM, JIRA issue tracking system and WSO2 document repository and portals to access them.
Dept of Comput. Sci. & Eng. University of Moratuwa
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...SL Corporation
The most critical large-scale applications today, regardless of industry, involve a demand for real-time data transfer and visualization of potentially large volumes of data. With this demand comes numerous challenges and limiting factors, especially if these applications are deployed in virtual or cloud environments. In this session, SL’s CEO, Tom Lubinski, explains how to overcome the top four challenges to real-time application performance: database performance, network data transfer bandwidth limitations, processor performance and lack of real-time predictability. Solutions discussed will include design of the proper data model for the application data, along with design patterns that facilitate optimal and minimal data transfer across networks.
Windows Server 2008 Security Overview ShortEduardo Castro
In this presentation we review the security changes in Windows 2008 and Windows 2008 R2
Saludos,
Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP
http://mswindowscr.org
http://comunidadwindows.org
Costa Rica
Technorati Tags: SQL Server
LiveJournal Tags: SQL Server
del.icio.us Tags: SQL Server
http://ecastrom.blogspot.com
http://ecastrom.wordpress.com
http://ecastrom.spaces.live.com
http://universosql.blogspot.com
http://todosobresql.blogspot.com
http://todosobresqlserver.wordpress.com
http://mswindowscr.org/blogs/sql/default.aspx
http://citicr.org/blogs/noticias/default.aspx
http://sqlserverpedia.blogspot.com/
Windows Server 2008 Security Overview ShortEduardo Castro
In this presentation we review the Security Changes in Windows 2008 and Windows 2008 R2.
Saludos,
Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP
http://mswindowscr.org
http://comunidadwindows.org
Costa Rica
Technorati Tags: SQL Server
LiveJournal Tags: SQL Server
del.icio.us Tags: SQL Server
http://ecastrom.blogspot.com
http://ecastrom.wordpress.com
http://ecastrom.spaces.live.com
http://universosql.blogspot.com
http://todosobresql.blogspot.com
http://todosobresqlserver.wordpress.com
http://mswindowscr.org/blogs/sql/default.aspx
http://citicr.org/blogs/noticias/default.aspx
http://sqlserverpedia.blogspot.com/
Fail-Safe Cluster for FirebirdSQL and something moreAlexey Kovyazin
With Firebird HQbird it is possible to create high available cluster or warm standby solution. This presentation defines the problem and describes ways how to create such solutions.
Firebird recovery tools and techniques by IBSurgeonAlexey Kovyazin
Presentation "Firebird recovery tools and techniques", by Alexey Kovyazin (IBSurgeon). This presentation is devoted to Firebird corruptions: why they occur, what are their symptoms, how to fix corruptions with Firebird standard tools and with advanced IBSurgeon tools and services.
This presentation is devoted to in-depth details of transactions implementation in Firebird database. If you are interesting to know how Firebird multi-version engine work with records, how record versions occur, what are main differences between snapshot and read commited transactions - this is waht you are looking for. Of course, this ppt does not cover all details, but gives an understanding what are transaction markers in Firebird, and why to important to keep transactions as short as possible.
There are more and more companies have big Firebird databases, from 100Gb till 1Tb. Maintenance and optimization tasks for such databases are different from small, and database administrators need take into account several important things about big Firebird databases.
Professional tools for Firebird optimization and maintenance from IBSurgeonAlexey Kovyazin
How to create better environment for big Firebird databases? How DBA can recognize and solve problems with Firebird performance, backups or corruptions (and better prevent corruptions)? This session was devoted to professional Firebird tools from IBSurgeon which help to solve all these problems.
In this presentation we consider how to resolve Firebird performance problems: what Firebird database parameters we need to monitor and how we need to tune Firebird configuration and adjust client applications.
FBScanner: IBSurgeon's tool to solve all types of performance problems with F...Alexey Kovyazin
FBScanner can be used to profile database applications, monitor user activity, manage database connections (including client disconnection on both Classic and SuperServer architecture). It’s also ideal for troubleshooting INET errors (INET/inet_error: send errno = 10054), as well as auditing existing applications and performance tuning.
Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)Alexey Kovyazin
Basic introduction to internal mechanism of Firebird optimizer. How it works, how it decides to use this or that index, why sometimes it fails and what you can do to improve performance? Definitely this presentation will not answer all these questions but it gives you a basic knowledge of Firebird optimizer internals. This is not for all developers and requires some qualification, definitely.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
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.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
11.
DATABASE TRIGGERS
Example of ON CONNECT trigger
isql temp.fdb -user SYSDBA -pass masterkey
Database: temp .fdb, User: SYSDBA
SQL> SET TERM ^ ;
SQL> CREATE EXCEPTION EX_CONNECT 'Forbidden !' ^
SQL> CREATE OR ALTER TRIGGER TRG_CONN ON CONNECT
CON> AS
CON> BEGIN
CON> IF (<bad user>)
CON> THEN EXCEPTION EX_CONNECT USER || ' not allowed !';
CON> END ^
SQL> EXIT ^
isql temp.fdb -user BAD_USER -pass ...
Statement failed, SQLCODE = -836
exception 217
-EX_CONNECT
- BAD_USER not allowed !
-At trigger 'TRG_CONN' line: 5, col: 3
Use CONNECT or CREATE DATABASE to specify a database
SQL> EXIT;
12.
13.
14.
15.
GLOBAL TEMPORARY TABLES
Referential integrity rules
on commit delete rows
on commit preserve rows
persistent
on commit delete rows
on commit preserve rows
persistent
master
detail
16.
GLOBAL TEMPORARY TABLES
database
CREATE GLOBAL TEMPORARY TABLE T1
attachment 1
attachment 2
pages not allocated
pages not allocated
pages allocated ( temporary file 1, FW = OFF )
pages freed ( temporary file deleted )
INSERT INTO T1
SELECT FROM T1
pages allocated
disconnect
pages freed ( temporary file deleted )
INSERT INTO T1
SELECT FROM T1
pages allocated ( temporary file 2, FW = OFF )
disconnect
pages not allocated
Common metadata
Private data
17.
18.
19.
20.
COMMON TABLE EXPRESSIONS
Example of simple ( non recursive ) table expressions
WITH
DEPT_YEAR_BUDGET AS (
SELECT FISCAL_YEAR, DEPT_NO, SUM(PROJECTED_BUDGET) AS BUDGET
FROM PROJ_DEPT_BUDGET
GROUP BY FISCAL_YEAR, DEPT_NO
)
SELECT D.DEPT_NO, D.DEPARTMENT,
B_1993.BUDGET AS B_1993, B_1994.BUDGET AS B_1994,
B_1995.BUDGET AS B_1995, B_1996.BUDGET AS B_1996
FROM DEPARTMENT D
LEFT JOIN DEPT_YEAR_BUDGET B_1993
ON D.DEPT_NO = B_1993.DEPT_NO AND B_1993.FISCAL_YEAR = 1993
LEFT JOIN DEPT_YEAR_BUDGET B_1994
ON D.DEPT_NO = B_1994.DEPT_NO AND B_1994.FISCAL_YEAR = 1994
LEFT JOIN DEPT_YEAR_BUDGET B_1995
ON D.DEPT_NO = B_1995.DEPT_NO AND B_1995.FISCAL_YEAR = 1995
LEFT JOIN DEPT_YEAR_BUDGET B_1996
ON D.DEPT_NO = B_1996.DEPT_NO AND B_1996.FISCAL_YEAR = 1996
WHERE EXISTS (SELECT * FROM PROJ_DEPT_BUDGET B WHERE D.DEPT_NO = B.DEPT_NO)
21.
COMMON TABLE EXPRESSIONS
Example of simple ( non recursive ) table expressions
22.
23.
24.
25.
COMMON TABLE EXPRESSIONS
WITH RECURSIVE
R_TREE (ID, LEVEL, PATH) AS
(
SELECT ID, 0, CAST(ID AS VARCHAR(255))
FROM TREE
WHERE PARENT_ID IS NULL
UNION ALL
SELECT TREE.ID, R_TREE.LEVEL + 1,
R_TREE.PATH || ‘.’ ||
CAST(TREE.ID AS VARCHAR(8))
FROM TREE, R_TREE
WHERE TREE.PARENT_ID = R_TREE.ID
AND R_TREE.LEVEL < 10
)
SELECT TREE.*, R_TREE.LEVEL, R_TREE.PATH
FROM TREE, R_TREE
WHERE TREE.ID = R_TREE.ID
Examples of recursive table expressions
26.
COMMON TABLE EXPRESSIONS
WITH RECURSIVE
FAMILY AS
(
SELECT PEOPLE, FATHER, MOTHER
FROM PEOPLES
WHERE NAME = :CHILD
UNION ALL
SELECT F.PEOPLE_ID, F.FATHER, F.MOTHER
FROM PEOPLES F, FAMILY
WHERE F.PEOPLE_ID = FAMILY .FATHER
UNION ALL
SELECT M.PEOPLE_ID, M.FATHER, M.MOTHER
FROM PEOPLES M, FAMILY
WHERE M.PEOPLE_ID = FAMILY .MOTHER
)
SELECT * FROM FAMILY
CREATE TABLE PEOPLES
(
PEOPLE_ID INT NOT NULL PRIMARY KEY,
NAME VARCHAR(255),
FATHER INT REFERENCES PEOPLES,
MOTHER INT REFERENCES PEOPLES
)
Examples of recursive table expressions
27.
COMMON TABLE EXPRESSIONS
WITH RECURSIVE
DEPT_YEAR_BUDGET AS
(
SELECT FISCAL_YEAR, DEPT_NO,
SUM(PROJECTED_BUDGET) AS BUDGET
FROM PROJ_DEPT_BUDGET
GROUP BY FISCAL_YEAR, DEPT_NO
),
DEPT_TREE AS
(
SELECT DEPT_NO, HEAD_DEPT, DEPARTMENT,
CAST('' AS VARCHAR(255)) AS INDENT
FROM DEPARTMENT
WHERE HEAD_DEPT IS NULL
UNION ALL
SELECT D.DEPT_NO, D.HEAD_DEPT, D.DEPARTMENT,
H.INDENT || ' '
FROM DEPARTMENT D JOIN DEPT_TREE H
ON D.HEAD_DEPT = H.DEPT_NO
)
Examples of recursive table expressions
SELECT D.DEPT_NO,
D.INDENT || D.DEPARTMENT AS DEPARTMENT,
B_1993.BUDGET AS B_1993, B_1994.BUDGET AS B_1994,
B_1995.BUDGET AS B_1995, B_1996.BUDGET AS B_1996
FROM DEPT_TREE D
LEFT JOIN DEPT_YEAR_BUDGET B_1993
ON D.DEPT_NO = B_1993.DEPT_NO
AND B_1993.FISCAL_YEAR = 1993
LEFT JOIN DEPT_YEAR_BUDGET B_1994
ON D.DEPT_NO = B_1994.DEPT_NO
AND B_1994.FISCAL_YEAR = 1994
LEFT JOIN DEPT_YEAR_BUDGET B_1995
ON D.DEPT_NO = B_1995.DEPT_NO
AND B_1995.FISCAL_YEAR = 1995
LEFT JOIN DEPT_YEAR_BUDGET B_1996
ON D.DEPT_NO = B_1996.DEPT_NO
AND B_1996.FISCAL_YEAR = 1996
28.
COMMON TABLE EXPRESSIONS
Examples of recursive table expressions
29.
30.
31.
DOMAINS EVERYWHERE
SQL> SET TERM ^ ;
SQL>
SQL> CREATE DOMAIN COLOUR VARCHAR(8)
CON> DEFAULT 'RED'
CON> CHECK (VALUE IN ('RED', 'GREEN', 'BLUE'))^
SQL>
SQL> EXECUTE BLOCK
CON> RETURNS (C1 COLOUR, C2 TYPE OF COLOUR)
CON> AS
CON> BEGIN
CON> SUSPEND;
CON> END ^
C1 C2
======== ========
RED <null>
Example : domain's DEFAULT value
32.
DOMAINS EVERYWHERE
SQL> CREATE OR ALTER PROCEDURE COLOUR_USING
CON> AS
CON> DECLARE C1 COLOUR;
CON> DECLARE C2 TYPE OF COLOUR;
CON> BEGIN
CON> C2 = 'BLACK';
CON> C1 = 'WHITE';
CON> END ^
SQL>
SQL> EXECUTE PROCEDURE COLOUR_USING ^
Statement failed, SQLCODE = -625
validation error for variable C1, value "WHITE"
-At procedure 'COLOUR_USING' line: 7, col: 3
SQL>
Example : domain's CHECK CONSTRAINT
33.
34.
35.
36.
37.
MERGE
CREATE TABLE AMOUNTS
(
GOODID INT,
SUMMA NUMERIC(18, 4),
CONSTRAINT PK_AMOUNTS
PRIMARY KEY (GOODID)
) ;
CREATE TABLE ENTRIES
(
GOODID INT,
DT DATE,
DBT NUMERIC(18, 4),
CRD NUMERIC(18, 4),
CONSTRAINT PK_ENTRIES
PRIMARY KEY (GOODID, DT)
) ;
MERGE INTO AMOUNTS USING ENTRIES E
ON GOODID = E.GOODID
WHEN MATCHED
THEN UPDATE SET SUMMA = SUMMA + E.DBT - E.CRD
WHEN NOT MATCHED
THEN INSERT (GOODID, SUMMA)
VALUES (E.GOODID, E.DBT - E.CRD)
MERGE example
38.
39.
Questions ?
Editor's Notes
- CONNECT
Database connection established
A transaction is started
Triggers are fired - uncaught exceptions rollback the transaction, disconnect the attachment and are returned to the client
The transaction is committed
- DISCONNECT
A transaction is started
Triggers are fired - uncaught exceptions rollback the transaction, disconnect the attachment and are swallowed
The transaction is committed
The attachment is disconnected
- TRANSACTION START
Triggers are fired in the newly user created transaction – uncaught exceptions are returned to the client and the transaction is rolled-back.
- TRANSACTION COMMIT
Triggers are fired in the committing transaction (before actual commit) - uncaught exceptions rollback the triggers savepoint, the commit command is aborted and the exception is returned to the client.
Note: for two-phase transactions the triggers are fired in &quot;prepare&quot; and not in commit.
- TRANSACTION ROLLBACK
Triggers are fired in the rolling-back transaction (before actual rollback) - changes done will be rolled-back togheter with the transaction and exceptions are swallowed
gfix and gstat connections does not fire database triggers
- CONNECT
Database connection established
A transaction is started
Triggers are fired - uncaught exceptions rollback the transaction, disconnect the attachment and are returned to the client
The transaction is committed
- DISCONNECT
A transaction is started
Triggers are fired - uncaught exceptions rollback the transaction, disconnect the attachment and are swallowed
The transaction is committed
The attachment is disconnected
- TRANSACTION START
Triggers are fired in the newly user created transaction – uncaught exceptions are returned to the client and the transaction is rolled-back.
- TRANSACTION COMMIT
Triggers are fired in the committing transaction (before actual commit) - uncaught exceptions rollback the triggers savepoint, the commit command is aborted and the exception is returned to the client.
Note: for two-phase transactions the triggers are fired in &quot;prepare&quot; and not in commit.
- TRANSACTION ROLLBACK
Triggers are fired in the rolling-back transaction (before actual rollback) - changes done will be rolled-back togheter with the transaction and exceptions are swallowed
gfix and gstat connections does not fire database triggers
- CONNECT
Database connection established
A transaction is started
Triggers are fired - uncaught exceptions rollback the transaction, disconnect the attachment and are returned to the client
The transaction is committed
- DISCONNECT
A transaction is started
Triggers are fired - uncaught exceptions rollback the transaction, disconnect the attachment and are swallowed
The transaction is committed
The attachment is disconnected
- TRANSACTION START
Triggers are fired in the newly user created transaction – uncaught exceptions are returned to the client and the transaction is rolled-back.
- TRANSACTION COMMIT
Triggers are fired in the committing transaction (before actual commit) - uncaught exceptions rollback the triggers savepoint, the commit command is aborted and the exception is returned to the client.
Note: for two-phase transactions the triggers are fired in &quot;prepare&quot; and not in commit.
- TRANSACTION ROLLBACK
Triggers are fired in the rolling-back transaction (before actual rollback) - changes done will be rolled-back togheter with the transaction and exceptions are swallowed
gfix and gstat connections does not fire database triggers
Intro
Sometimes programmers have necessity for the data with temporary nature. For example - create a data set, work with it and remove it. If it is necessity is seldom or in general once then it is possible to create and drop the table. But what to do if such tasks arises frequently ? Constant creation and dropping of tables at first is not good from the security point of view (end users usual have no such rights), at second it is extremely not recommended to perform DDL on production database and, at third, productivity of such approach is far from perfect. Besides if the own set of temporary data are needed for several users simultaneously, they will be compelled to assign them unique names, and it means that stored procedures can't work with such tables.
One of the widespread approaches to get rid of these problems is to create the permanent table with an additional service field populated with CURRENT_USER or with the private value of generator used during data sets lifetime. In spite of the fact that this approach is free from lacks of previous one it also has its own lacks. In particular because of frequent deletions many record versions will be accumulated which then should be removed from database. Since usually additional field is indexed and included in all queries to such tables the removed records are never visited again and this garbage will sit in DB until the sweep runs.
Fortunately the SQL standard has the solution of such problems (yes it not always prevents quiet life of the ordinary programmer :). This solution is a various kinds of temporary tables. Today we consider global temporary tables as they were implemented in IB 7.5 first, then it was included in Fyracle and now they are in Firebird also
Definition
Global temporary tables (GTTs) are tables with permanent metadata, stored in the system catalogue, but with the temporary data. GTT's may be of two kinds - with the data, persistent within lifetime of connection in which the given GTT was referenced, and with the data, persistent within only during lifetime of referencing transaction. The data from different connections (transactions) are isolated from each other, but metadata of the global temporary table are shared between all connections and transactions.
All kinds of constraints between temporary and persistent tables follow the rule below:
a) references between persistent and temporary tables are forbidden
b) GTT with ON COMMIT PRESERVE ROWS can't have reference on GTT with ON COMMIT DELETE ROWS
c) Domain constraints can't have reference on GTT.
This is a table for easier understanding of which references are allowed
Implementation details:
GTT instance (set of data rows created by and visible within given connection or transaction) created when it first referenced, usually at statement prepare time. Each instance has its own private set of pages on which data and indexes are stored. Data rows and indexes have the same physical storage layout as permanent tables.
When connection or transaction ends all pages of an GTT instance are released immediately (this is similar as when you do DROP TABLE but metatada remains in database of course). This is much quicker than traditional row by row delete + garbage collection of deleted record versions. Each data (index) page contains rows (keys) from the same GTT instance therefore connection ransaction should readwrite less pages than if an GTT instances were isolated by the service field. Note that with “service field” design data pages will contain rows also from old dead connections or transactions until it will be garbage collected.
Sometimes our design required more space than “service field” design. For example 10 instances of GTT each with one row occupied 10 data pages, while “service field” design needs only one page (if it can fit 10 rows). But this difference visible only with big amount of small tables and we assume it reasonable price for benefits (speed and near instant cleanup).
In Fyracle data pages of all of the GTT’s instances placed in the database file. In Firebird 2.1 this pages placed in separate temporary file’s – this allows to put temporary data into another hard disk and reach more performance level. Each connection have its own temporary file created when this connection first referenced some GTT. Also this temporary files always opened with “Forced writes = OFF” settings despite of database setting.
There are no limit on number of GTT instances. If you have N transactions active simultaneously and each transaction have referenced some GTT then you’ll have N GTT’s instances.
CTE is standard feature. It is supported in modern versions of DB2, ORACLE, MSSQL, ASA. In FB history it was first implemented in Fyracle by Paul Ruizendaal to support Oracles non standart syntax of recursive queries.
CTE allows to write very complex queries in simple, natural manner. All you need is just decompose complex query by simple parts (as you often do with complex procedures in such programming language as C, PASCAL etc), assign names to this parts and use it in near any possible combinations.
CTE is like view’s, locally defined within main query. Or we can compare it with local procedures in pascal language. From the engine POV CTE is a derived table so no intermediate materialization is performed
WITH can’t be nested but this is not a strict limitation as you always can reference one CTE from another
Here the simple example of how we can build cross-tab report about per year budget of each department using one CTE several times in the same query. Our standard “employee” database is used in this example (someone can even remember it :)
We defined CTE DEPT_YEAR_BUDGET which sums per-year budget of each department. Then we join it four times with DEPARTMENT table to build our simple cross-tab. Also we exclude from report departments which have no budget at all
This example shows that we can reuse same CTE several times in query
here the results of query above.
Well, CTE is a powerful mechanism to create complex, powerful query. But that’s not all.
With recursive CTE we can create even recursive queries now.
How it work:
engine start execution from non-recursive members
for each evaluated row engine start execution of each recursive member using current row values as parameters
if current instance of recursive member produced no rows engine returns one step back and get next row from previous resultset
Memory and CPU overhead of recursive CTE is much less than overhead of recursive stored procedures
currently recursion depth is limited by hardcoded value of 1024
it will be discussed later about implement non standard optional syntax enhancement to allow user specify maximum recursion level immediately in query
Aggregates limitation come from standard. I have no clear explanation of it
This example shows how to solve several classical tasks when working with recursive data structures
query returns tree-like table in order of tree walk. it is very useful if client application can’t itself show tree-like structure
we see how easy nesting level can be evaluated
we see how we can limit number of processed levels of tree
we also return full path from the root to the current tree node – it can be used by client application as a hint to end-user
this example is more complex. it shows how two recursive members is used to return two recursion path
very simple table PEOPLE contains ID of people, his name and ID’s of his parents
query returns whole genealogical tree of given people - i.e. his parents, parents of his parents and so on
also we see that parameters can be used inside of CTE also (if someone think it is allowed in main query only)
return to the our example of use of simple CTE and include department’s as a tree into that cross-tab report
let define CTE DEPT_TREE which shows departments in tree-like style and replace in main query plain table DEPARTMENT by this recursive CTE
To let our report looks as real tree I included INDENT field into our recursive CTE DEPT_TREE. More nesting level – more indentation of name
Easy is not is ?
Note - error message contains variable name and linecolumn numbers