Tuesday, April 8, 2025

Tigergraph DB - Understanding of basic query structure

resultSet = SELECT vSet FROM (edgeSet | vertexSet) [whereClause] [accumClause] [postAccumClause] [havingClause] [orderClause] [limitCluase];


Hierarchy from top to bottom


FROM

WHERE

ACCUM

POST-ACCUM

HAVING

ORDER BY

LIMIT

SELECT


FROM: select active vertices & edges

WHERE: conditionally filter the active sets

ACCUM: iterate on edge set; compute with accumulators

POST-ACCUM: iterate on vertex sets; computer with accumulators

HAVING: conditionally filter the result set

ORDER BY: sort

LIMIT: max number of items

SELECT: result from source or target set

***

Monday, April 7, 2025

Enabling audit on Tigergraph DB 4.1.2

Database Name: <ProjectName>_<Environment>

Ex: pramod_stage


$ gadmin config set System.Audit.Enable true

$ gadmin config set System.Audit.DatabaseName pramod_stage

$ gadmin config apply -y

$ gadmin restart all -y


Points:

Each audit log file is a JSON array of JSON objects, one object per log entry.

Each object is formatted as a single line for better readability of high volume data.

Each audit log file is a JSON array of JSON objects, one object per log entry.

The log entry include the timestamp, the user id, the action type, and the object being acted on.

The graph name is logged for queries and loading jobs.



3 different log files are created under logs directory for below services which will be audited.

log.AUDIT-GSQL for the GSQL service.

log.Audit-RESTPP for direct REST++ API calls.

log.Audit-GADMIN for gadmin command executions.

***