> ## Documentation Index
> Fetch the complete documentation index at: https://docs.falkordb.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> FalkorDB is a graph database that speaks the Redis protocol. Queries are issued as OpenCypher through the GRAPH.QUERY and GRAPH.RO_QUERY commands, not over Bolt or a SQL connection.
> FalkorDB implements a subset of OpenCypher with proprietary extensions. Do not assume Neo4j-only syntax or procedures are available — check /cypher/cypher-support and /cypher/known-limitations before using a clause.
> FalkorDB is the successor to RedisGraph, but they are separate products. Do not present RedisGraph commands, versions, or limitations as current FalkorDB behavior.
> Use the official clients listed in /getting-started/clients rather than generic Redis or Neo4j drivers, and prefer the language the user is already working in.
> Configuration parameters are set with GRAPH.CONFIG SET or at startup; cite the exact parameter name from /getting-started/configuration rather than inventing one.
> This site covers four products: FalkorDB (core), FalkorDB Cloud, FalkorDB Enterprise, and the GraphRAG SDK. Name which one an answer applies to, since setup and operations differ.

# GRAPH.SLOWLOG

> View the 10 slowest queries executed against a FalkorDB graph with GRAPH.SLOWLOG command. Monitor query performance, execution times, and optimize slow operations.

Returns a list containing up to 10 of the slowest queries issued against the given graph ID.

Only queries with a latency of 10 milliseconds or more are logged.

Each item in the list has the following structure:

1. A Unix timestamp (double) at which the log entry was processed.
2. The issued command.
3. The issued query.
4. The amount of time needed for its execution, in milliseconds (double).
5. The query parameters (or (nil) if none were provided).

## Examples

### Get slowlog

<CodeGroup>
  ```python Python theme={null}
  from falkordb import FalkorDB
  db = FalkorDB(host='localhost', port=6379)
  graph = db.select_graph('graph_id')
  slowlog = graph.slowlog()
  print(slowlog)
  ```

  ```javascript JavaScript theme={null}
  import { FalkorDB } from 'falkordb';
  const db = await FalkorDB.connect({
    socket: { host: 'localhost', port: 6379 }
  });
  const graph = db.selectGraph('graph_id');
  const slowlog = await graph.slowLog();
  console.log(slowlog);
  ```

  ```bash Shell theme={null}
  GRAPH.SLOWLOG graph_id
  ```
</CodeGroup>

### Sample Output

```sh theme={null}
GRAPH.SLOWLOG graph_id
 1) 1) "1581932396.723"
    2) "GRAPH.QUERY"
    3) "MATCH (a:Person)-[:FRIEND]->(e) RETURN e.name"
    4) "12.831"
    5) (nil)
 2) 1) "1581932396.891"
    2) "GRAPH.QUERY"
    3) "MATCH (me:Person)-[:FRIEND]->(:Person)-[:FRIEND]->(fof:Person) RETURN fof.name"
    4) "10.288"
    5) (nil)
```

### Reset slowlog

<CodeGroup>
  ```python Python theme={null}
  graph.slowlog_reset()
  ```

  ```bash Shell theme={null}
  GRAPH.SLOWLOG graph_id RESET
  ```
</CodeGroup>

Once cleared the information is lost forever.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is the minimum latency for a query to appear in the slowlog?">
    Only queries with a latency of **10 milliseconds or more** are logged in the slowlog.
  </Accordion>

  <Accordion title="How many entries does the slowlog store?">
    The slowlog stores up to **10** of the slowest queries issued against the given graph. Older entries are evicted when new slower queries are recorded.
  </Accordion>

  <Accordion title="Can I reset the slowlog?">
    Yes. Use `GRAPH.SLOWLOG graph_name RESET` to clear all entries. Note that once cleared, the information is lost permanently.
  </Accordion>

  <Accordion title="What information is included in each slowlog entry?">
    Each entry contains: (1) Unix timestamp, (2) the issued command, (3) the query string, (4) execution time in milliseconds, and (5) query parameters or nil if none were provided.
  </Accordion>
</AccordionGroup>
