What is indexed

When executing the following query:

SELECT mean(“speed”) AS “mean_speed” FROM “mydb”.“car” WHERE time > x AND time < y GROUP BY time(1d)

Is only data between the two time ranges loaded into memory?

I don’t know if anyone on the community will be able to answer this.

Your best bet is to go look into the InfluxDB codebase and do some investigation

Hi @moinster - I’m curious why you are asking what data is loaded into memory. Are you just curious also or are you having a problem doing what you want to do? If you can provide further information, it would help the community understand what your goals are and better provide guidance. For instance, which version of influxdb are you using?

@moinster -

Here is some general guidance. TSM blocks that match the time range of your query will be accessed. These blocks are memory mapped and may include some data slight before and after your time range.

As for what is indexed, TSI files are not organized by time so index information outside your query time range may also be mapped into memory. The index may be configured to be in-memory entirely or make use of memory mapped TSI files.

If you have more questions, please let us know!