Using multiples queries, in the same update loop. Unity ECS

I am trying to check the range of entities with a certain tag, from entities with a different tag.

If I use two separate queries to gather the different types of entities, I am not sure if re-gathering the query every frame is inefficient or not.

To deal with that, I can move the queries to the OnCreate(), or OnStartRunning() handles.

However, does this mean the query only has the members at that capture time? Or do the queries automatically handle updating somehow… Or, do I need to consider something else.

EntityQuery needs no updates, because:

An entity query defines the set of component types that an archetype must contain in order for its chunks and entities to be selected (…)
and:

(…) and specifies whether the components accessed through the query are read-only or read-write.

So, fundamentally, this is all what EntityQuery is: a collection of requirements to filter/select chunks - you don’t have to update it if you don’t want to. It’s something of a key with which one can iterate over specific chunks to access their data and this key stays valid while chunks it selects change.

public class MySystem : SystemBase
{
	EntityQuery _query1;
	EntityQuery _query2;
	protected override void OnCreate ()
	{
		_query1 = EntityManager.CreateEntityQuery(
				ComponentType.ReadOnly<MyComponent>()
		);
		_query2 = EntityManager.CreateEntityQuery(
				ComponentType.ReadWrite<MyComponent>()
			,	ComponentType.ChunkComponent<MyChunkyComponent>()
			,	ComponentType.Exclude<MyNahComponent>()
		);
	}
	protected override void OnUpdate ()
	{
		/* queries will always be up-to-date here */
	}
}