Skip to content

Conversation

@meiravgri
Copy link
Contributor

@meiravgri meiravgri commented Dec 11, 2025

MOD-12263 vector iterator details: Added detailed notes on vector iterator profiles, including vector search modes and batch execution statistics.
MOD-6056 rename “counter” and “size”

MOD-12816 update ResultProcessor GILTime

MOD-12414 Add internal cursor reads to profile documentation

MOD-12321 Add shard unique ID

Added detailed notes on vector iterator profiles, including vector search modes and batch execution statistics.
@CLAassistant
Copy link

CLAassistant commented Dec 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

@dwdougherty
Copy link
Collaborator

Hi @meiravgri. Please sign the CLA. I'll review today.

@meiravgri meiravgri changed the title MOD-12263 vector iterator details [MOD-6057] Improve and elaborate FT.PROFILE documentaion Dec 11, 2025
@dwdougherty dwdougherty changed the title [MOD-6057] Improve and elaborate FT.PROFILE documentaion [MOD-6057] Improve and elaborate FT.PROFILE documentation Dec 12, 2025
Copy link
Contributor

@alonre24 alonre24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

| `Total` `profile` `time` | The total run time (ms) of the query. Normally just a few ms. |
| `Parsing` `time` | The time (ms) spent parsing the query and its parameters into a query plan. Normally just a few ms. |
| `Pipeline` `creation` `time` | The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for `FT.SEARCH` queries, but expect a larger number for `FT.AGGREGATE` queries. |
| `Total` `GIL` `time` | The total time (ms) the query held the Global Interpreter Lock (GIL) during execution. Relevant for multi-threaded deployments where queries run in background threads. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lerman25, Evntually, do we expect this field to exist in case of non multithreaded deployment? If so, what should be the value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, if we don't have workers - this field doesn't print (starting from RediSearch/RediSearch#7756)

| `Total` `profile` `time` | The total run time (ms) of the query. Normally just a few ms. |
| `Parsing` `time` | The time (ms) spent parsing the query and its parameters into a query plan. Normally just a few ms. |
| `Pipeline` `creation` `time` | The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for `FT.SEARCH` queries, but expect a larger number for `FT.AGGREGATE` queries. |
| `Total` `GIL` `time` | The total time (ms) the query held the Global Interpreter Lock (GIL) during execution. Relevant for multi-threaded deployments where queries run in background threads. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's refer it as the Global Redis Lock, and explain when we are expected to hold it (upon LOADing non sortable fields). Also, does it include the time we are waiting for the GIL, or only the time we are actually holding it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It include the time waiting for the GIL ( We start the timer, and then call RedisModule_ThreadSafeContextLock)

| `Pipeline` `creation` `time` | The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for `FT.SEARCH` queries, but expect a larger number for `FT.AGGREGATE` queries. |
| `Total` `GIL` `time` | The total time (ms) the query held the Global Interpreter Lock (GIL) during execution. Relevant for multi-threaded deployments where queries run in background threads. |
| `Warning` | Errors that occurred during query execution. |
| `Internal` `cursor` `reads` | The number of internal cursor read operations performed during a distributed `AGGREGATE` query in cluster mode. In cluster mode, the coordinator uses cursors to fetch results from shards - this counts the initial request plus any subsequent `FT.CURSOR READ`. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rephrasing instead of using ft.cursor read, so it will not mix up with user cursors. Maybe something like "... any subsequent batch of results featching from the shard"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* `EMPTY`
* `WILDCARD`
* `OPTIONAL`
* `OPTIMIZER` with `Optimizer mode` - Enabled by default in dialect 4+, or explicitly with `WITHOUTCOUNT`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true for both ft.search and ft.aggregate? cause ft.aggregate is without count by default AFAIK

| `Total` `profile` `time` | The total run time (ms) of the query. Normally just a few ms. |
| `Parsing` `time` | The time (ms) spent parsing the query and its parameters into a query plan. Normally just a few ms. |
| `Pipeline` `creation` `time` | The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for `FT.SEARCH` queries, but expect a larger number for `FT.AGGREGATE` queries. |
| `Total` `GIL` `time` | The total time (ms) the query held the Global Interpreter Lock (GIL) during execution. Relevant for multi-threaded deployments where queries run in background threads. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `Total` `GIL` `time` | The total time (ms) the query held the Global Interpreter Lock (GIL) during execution. Relevant for multi-threaded deployments where queries run in background threads. |
| `Total` `GIL` `time` | The total time (ms) the query held the Global Interpreter Lock (GIL) during execution. This field is only applicable for shards in clustered environments and may present a value on the coordinator that does not reflect actual GIL usage.|

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| `Total` `GIL` `time` | In multi-threaded deployments, the total time (ms) the query spent holding and waiting for the Redis Global Lock (referred to as GIL) during execution. Note: this value is only valid in the shards profile section. |

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about emphasizing that's invalid any other place?

| Total GIL time | In multi-threaded deployments, the total time (ms) the query spent holding and waiting for the Redis Global Lock (referred to as GIL) during execution. Note: this value is only valid in the shards profile section; invalid elsewhere.. |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think necessary

| `Scorer` | The `Scorer` processor assigns a relevance score to each document based on the query’s specified scoring function. This function could involve factors like term frequency, inverse document frequency, or other weighted metrics. |
| `Sorter` | The `Sorter` processor arranges the query results based on a specified sorting criterion. This could be a field value (e.g., sorting by price, date, or another attribute) or by the score assigned during the scoring phase. It operates after documents are fetched and scored, ensuring the results are ordered as required by the query (e.g., ascending or descending order). `Scorer` results will always be present in `FT.SEARCH` profiles. |
| `Loader` | The `Loader` processor retrieves the document contents after the results have been sorted and filtered. It ensures that only the fields specified by the query are loaded, which improves efficiency, especially when dealing with large documents where only a few fields are needed. |
| `Threadsafe-Loader` | The `Threadsafe-Loader` processor safely loads document contents when the query is running in a background thread. It acquires the GIL to access document data. Reports an additional `GIL-Time` field showing how long (ms) it held the GIL. |
Copy link
Contributor

@lerman25 lerman25 Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `Threadsafe-Loader` | The `Threadsafe-Loader` processor safely loads document contents when the query is running in a background thread. It acquires the GIL to access document data. Reports an additional `GIL-Time` field showing how long (ms) it held the GIL. |
| `Threadsafe-Loader` | The `Threadsafe-Loader` processor safely loads document contents when the query is running in a background thread. It acquires the GIL to access document data. Reports an additional `GIL-Time` field representing both GIL hold time and time spent waiting to obtain the GIL.|

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| `Threadsafe-Loader` | The `Threadsafe-Loader` processor safely loads document contents when the query runs in a background thread (relevant for multi-threaded deployments). It acquires the Redis Global Lock (referred to as GIL) to access document data. Reports an additional `GIL-Time` field representing the time (ms) spent holding the GIL and waiting to acquire it. |

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@dwdougherty dwdougherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes as part of my copy-edit pass. Approving.

@dwdougherty dwdougherty merged commit 18feb83 into main Dec 16, 2025
7 checks passed
@dwdougherty dwdougherty deleted the meiravgri-ft-profile-docs branch December 16, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants