When you retrieve data from LUSID you can typically filter the result set to qualify the data returned.
For example, the following call to the ListInstruments
API applies a filter expression of name startswith 'App'
to retrieve just those instruments with 'App…'-like names:
curl -X GET "https://<your-domain>.lusid.com/api/api/instruments?filter=name%20startswith%20%27App%27"
-H "Authorization: Bearer <your-API-access-token>"
Note: There is a maximum URL length of 2048 characters that may impact the complexity of any filter expression you submit via the LUSID API. This restriction does not apply if you filter LUSID data using Luminesce.
As you can see from the table below, the slowest filter expressions are those that query non-string properties. We are currently working to make these more performant, and hope to have an update soon. Note that other factors less easy to tabulate may also affect performance, such as the size of your LUSID dataset and the number of filter expressions you choose to join together using the and
or or
operators.
Speed | Entity attribute to filter on | Data type of attribute | Filter operator | Example |
Faster | Fields and nested fields | Any | eq | name eq 'BP' |
Identifiers | identifiers['Isin'] eq 'GB0007980591' | |||
SHKs (portfolios only) | subholdingkeys[Transaction/Demo/Strategy] eq 'Income' | |||
Single-value properties | string | properties[Instrument/Ibor/Industry] eq 'Energy' | ||
Custom data fields (custom entities only) | Any | fields['Address'] eq '1 Main Street' | ||
Multi-value properties | string | properties[Instrument/Ibor/Industry] all (~ eq 'Energy') | ||
Relationships (supported entities only) | Any | relationships any (Instrument.name eq 'BP') | ||
As above, in the same order | gt gte lt lte startswith in | name startswith 'BP' | ||
As above, in the same order | exists neq not exists not in | name neq 'BP' | ||
As above, in the same order | and | name eq 'BP' and domCcy eq 'GBP' | ||
As above, in the same order | or | name eq 'BP' or domCcy eq 'GBP' | ||
Slower | Properties | Any except string | As above, in the same order | properties[Instrument/Ibor/Date] gt 2022-01-01 |