Query by createdDate is slow

Description

This API call takes over 90 minutes to complete because it does sequential scanning of the table that has over 18M records. 
/inventory/instances?offset=0&limit=250&query=metadata.updatedDate>2023-02-10T03:39:00Z or metadata.createdDate>2023-02-10T03:39:00Z
 

The CQL query yielded this SQL query:

 

The performance of this query needs to be improved possibly by creating an index on instance.jsonb->‘metadata’->>‘createdDate’  json field in mod_inventory_storage.instance (see 's comment below, or something else more appropriate).

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Pavlo Smahin June 16, 2023 at 8:27 AM

Hey , could you please create a bug for it in the mod-search project?

Martin Tran June 15, 2023 at 8:44 PM

the CQL query almost worked. It works when either clauses are specified individually but when they are connected by the "or" operator it returns this error:

Khalilah Gambrell May 29, 2023 at 12:33 PM

reassigned to PTF. 

Pavlo Smahin May 9, 2023 at 6:11 PM

, the most performant way is to use the mod-search endpoint:

Martin Tran May 9, 2023 at 4:53 PM

Hi , in their custom app the library created a query exactly like this:

Basically they want to find instances by createdDate or updatedDate.

Is there a better alternative to find instances by these two fields?

 

Details

Assignee

Reporter

Priority

Development Team

PTF

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created February 16, 2023 at 12:07 PM
Updated March 6, 2024 at 7:31 AM
TestRail: Cases
TestRail: Runs