Multiple QueryConditions on a single reader

4 posts / 0 new
Last post
njc
Offline
Last seen: 10 years 1 month ago
Joined: 08/09/2012
Posts: 17
Multiple QueryConditions on a single reader

I'm trying to understand the restrictions on creating multiple QueryConditions on a single reader. The docs say: "Two query conditions that have the same query_expression will require unique query condition content filters if their query_paramters differ. Query conditions that differ only in their state masks will share the same query condition content filter."

I'm making QueryConditions that use the same query_expression, but have different query_parameters. How do I create unique "query condition content filters"? I have a data reader shared by multiple threads. Each thread is interested in a separate subset of the data and I'm using QueryConditions to partition the data. When a thread wants to read, it'll create a query condition using the same query expression, but different query parameter. I'm finding I can only create a handful (maybe ~5) QueryConditions before creation of QueryConditions starts failing.

What is the best way to go about this?


Thanks!

Offline
Last seen: 10 years 6 months ago
Joined: 06/24/2013
Posts: 8

You are encountering the reader reasource limit DDS_DataReaderResourceLimitsQosPolicy::max_query_condition_filters, which controls the allocation limits for Query Condition filters. The default value is 4, so failing at 5 is expected. You can set this limit as high as 32.

Setting this limit higher should help your initial problem.

njc
Offline
Last seen: 10 years 1 month ago
Joined: 08/09/2012
Posts: 17

That did it. Thanks!

ilya_1725's picture
Offline
Last seen: 1 year 10 months ago
Joined: 04/20/2020
Posts: 24

What is the solution to this problem without increasing  max_query_condition_filters?

The manual states "more than 32 QueryConditions may be created per DataReader, if they are different mask-combinations of the same content filter.".


Does it mean, for example that I can set  query_expression = "id = %0" and pass id values in  query_parameters and it will all use just one conditioning filter?