WL#5863: PERFORMANCE SCHEMA, NESTED-SET data model

Affects: Server-Prototype Only   —   Status: Complete

Implement columns to support the NESTED-SET model,
for tables:
- events_waits_current / history / history_long
- events_stages_current / history / history_long
- events_statements_current / history / history_long

Currently, relationships are using:
- EVENT_ID (PK)
- NESTING_EVENT_ID / NESTING_EVENT_TYPE (FK)
so only the ADJACENT-LIST model is supported.

See
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

Edit, 2012-11-26: the previous link is not valid anymore.
For an alternate description, see:
http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

In particular, add a END_EVENT_ID column to event tables, so that:

"Event B is included in event A"
can be computed as

A.EVENT_ID <= B.EVENT_ID and B.END_EVENT_ID <= A.END_EVENT_ID

without having to follow each parent / child relation using NESTING_EVENT_ID.