EKOSdocs
Docs / Guides Build

The Interaction Map

Who reads and writes each table — routines, application code, ETL jobs and database roles — as the code declares it and as the database was seen doing.

Before you move or change a table you need to know who writes it. The code says part of it; the database's own statement statistics say the rest, including the writers nobody mentioned. The interaction map puts both side by side (RFC 0256): new in v1.5.0, completed in v1.5.5.

Actors

Kind What Source
routine a procedure, function or trigger SQL files and live catalogs
component application code, grouped by its leading directories ([interaction] component-depth, default 1) Java SQL and other code that states SQL
etl_job a Kettle job or transformation Pentaho files; Update, InsertUpdate, Delete and SynchronizeAfterMerge steps write their lookup table
process an iDempiere AD_Process / AD_Scheduler entry, acting through the procedure or Java class it runs the application dictionary (dictionary = "idempiere", Oracle or PostgreSQL)
db_role a database role seen running statements observed access, below

Only code the latest compiled model holds counts, so a deleted job is no longer an actor (since v1.5.5).

The matrix

ekos interaction matrix                        # tables × actors, the operations each performs
ekos interaction matrix --table C_ORDER
ekos interaction matrix --actor etl_job:nightly_load --json

Each cell is marked declared (stated by code), observed (seen in the database) or both.

Observed access

ekos interaction observe                       # every [[databases]] entry, through the read-only probe session
ekos interaction observe --database erp

observe reads the engine's statement statistics, parses each statement in its own dialect into the tables it reads and writes, aggregates per (role, table, operation) and drops the statement text. Nothing but counts and a window is kept.

Engine Reads Notes
PostgreSQL pg_stat_statements; pg_stat_user_tables as a cross-check needs the extension installed. The window starts at the view's last reset; evictions mark the observation incomplete
Oracle V$SQL joined to ALL_USERS (the reader needs SELECT_CATALOG_ROLE) cursors age out of the shared pool, so every Oracle observation is partial
ClickHouse system.query_log the window starts at the oldest entry kept; no table counters
SQL Server, Informix — they record no per-login statement statistics EKOS reads, and every surface says "provides no usage statistics", not an empty list
  • An observation is dated and partial, and is labelled so everywhere: "not observed" over a three-day window is not "never happens".
  • EKOS's own sessions are left out. Schema statements are counted apart (ddl_calls).
  • Each observed cell carries first_observed and calls_since_previous (since v1.5.5).
  • Role names can be a person's account: [interaction] roles = "names" (default), "hashed" (salted; two roles stay distinct) or "off" (no observed access is read).

Findings

ekos interaction findings
Finding When
unexplained_writer a role writes a table, and no actor linked to that role declares a write to it
unattributed_writes table counters show writes that no observed statement explains (PostgreSQL)
multiple_writing_systems two or more unlinked actors write the same table
declared_not_observed a declared write with zero observed calls, over a window longer than [interaction] quiet-after-days (default 30) that was not truncated. Never derived from a partial (Oracle) observation
read_only_consumers the actors that only read a table: not a problem, but the list of who breaks if it changes

The first three raise open questions, routed to the people likely to know (People as a Source). A finding is derived, not a decision.

Which system is this role?

A role is linked to a system only by evidence, and only as a hypothesis: it is the user of exactly one system's connections (a Kettle connection's user name, never its password), or the tables it touches are contained in one component's tables and no other's. Each link is an item of the optional review subject interaction, which appears once observe has seen roles writing:

ekos review show interaction
ekos review interaction etl_nightly --confirm --reason "the finance team's nightly export"
ekos review interaction fixer --reject --reason "not the order importer"

A trigger explains no role's write: it runs because a statement wrote the table.

Agents, console, documentation and the lakehouse

  • MCP: ekos_interaction, read-only and scoped, with table and actor filters and the findings.
  • Console: the Interaction page shows the matrix per table and a Systems graph (components, ETL jobs, processes and roles writing into and reading out of tables; at most 25 tables, the most written first, with a count of those left out).
  • Estate documentation: every table page has "Writers and readers", with the observed column, its window and open findings.
  • EKOS Lakehouse: a table with an unexplained_writer or unattributed_writes carries a warning on the extraction plan, with advice and its cost. EKOS advises; the plan's load mode changes only when a person says so, and keeping it is recorded too (Building a Lakehouse).

Measured

  • PostgreSQL: a Kettle job connecting as etl_nightly and updating customers was proposed as that job by its connection. Its update became explained; its delete of orders, which the job does not declare, stayed an unexplained_writer.
  • ClickHouse 24.8: a scripted workload (5 inserts, 3 selects, 1 insert, 3 DDL statements) came back as exactly those cells, 0 unparsed.
  • Oracle XE 21c (iDempiere seed): a planted role's 4 updates of C_BPARTNER became exactly that cell and an unexplained_writer; EKOS's own 24 calls were left out; 337 dictionary processes read, equal to a direct count.

Not yet: observed access on SQL Server and Informix; dictionary processes outside iDempiere.