# Performance Testing

The **Log query time** option can be enabled for any [Separation Rule](https://docs.yansalabs.com/simple-data-separation/technical-docs/separation-rules) in order to access detailed execution time & triage performance issues.

{% hint style="info" %}
Log query timing is for testing only and should be disabled after use & in production environments.
{% endhint %}

<figure><img src="https://3608496382-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFWzDVFtUmUZRWKbnGTMs%2Fuploads%2FlOTSRS6Z15gwZsxZKiOt%2F007.png?alt=media&#x26;token=bdf6d52b-a740-4fdc-a148-80c6abd6b7be" alt=""><figcaption><p>Log query time on Separation Rule</p></figcaption></figure>

When enabled, any execution of the Separation Rule (by accessing data on the associated table) will trigger an output of detailed execution timing to the **System Log**.

<figure><img src="https://3608496382-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFWzDVFtUmUZRWKbnGTMs%2Fuploads%2Foait1Y4HeggMYQ0bBB4R%2F008.png?alt=media&#x26;token=601e69ca-e8de-406a-9068-44c4f3011e86" alt=""><figcaption><p>Query Time Log</p></figcaption></figure>

The query time log is split into sections:

* **Test Details**: Separation Rule name, table, and initiating user
* **Query Time**: DB query time both before & after data separation parameters have been added. *Note: Query time is non-inclusive of function time.*
* **Function Time**: Time required for each function called during construction of the data separation query. *Note: Function time is non-inclusive of query time. Only those functions used will be shown.*
  * *getApproverTasks*: Gather all 'approval needed' records for **Approver overrides**.
  * *hasVisibilityGroups*: Assess whether user is member of a **Visibility group**.
  * *setValidAccessRequestRecords*: Gather active, approved **Access Request** records.
  * *getUserAudience*: Assess user membership for any standard **Separator field** (group, department, company, location, etc). *This can be called multiple times within a single query - timing is provided cumulatively and per-instance.*
  * *getDefinedRelationship*: Evaluate a **Defined Relationship**. *This can be called multiple times within a single query - timing is provided cumulatively and per-instance.*
* **Caching**: Details of enablement & usage of cached data
  * *Query cache*: Query cache is enabled per [Separation Rule](https://docs.yansalabs.com/simple-data-separation/technical-docs/separation-rules) & caches the results of the query script. Query caching improves overall query generation speed before the query is sent to the database.
  * *Session cache*: Session cache is enabled in Simple Data Separation [General Settings](https://docs.yansalabs.com/simple-data-separation/technical-docs/general-settings). Session caching improves performance in many areas of Separation Rule function timing.
