Short version: Are there any limits to how many hash strings you can pass to a query eq filter? I have a query with 110 strings in an array, and not all of the results seem to be returned. I checked the documentation and did not see anything. I am using version 20.07 on windows with no license.
Long, highly detailed version:
For the past couple of months, I’ve been developing a database for modeling the interactions of equipment at a manufacturing facility and ran into a strange issue today. Each piece of equipment has a unique string fieldID which we use to identify it out in the field. I insert the data with this fieldID and search it by hash string (see partial schema below). I am trying to query data from my database using the DQL python library. When I pass a large number of arguments (110 in this case) to the eq filter, I don’t get all the data I expect. I know the data is in the database because I can use 3 arguments to the filter and get the expected response. Below is the query I am running (I copied it into Ratel with the same result, so I don’t believe this is a python issue).
I run the following query (xxx is defined below)
{
getEquipmentByFieldID(func: eq(equipment.fieldID, xxx)){
equipment.fieldID
equipment.interlocks{
intAct.interlocks{
uid
interlock.fieldID
interlock.steps
interlock.process
}
}
equipment.dcsGroup{
equipment.interlocks{
intAct.interlocks{
uid
interlock.fieldID
interlock.steps
interlock.process
}
}
}
}
where the objects are created using this GraphQL schema.
interface baseFieldEle {
id: ID!
files: [baseFile] @hasInverse(field: fieldElements)
drawElement: drawEle @hasInverse(field: fieldElement)
neighbors: [baseFieldEle] @hasInverse(field: neighbors)
}
type equipment implements baseFieldEle {
rawText: String! @search(by: [regexp])
normalPos: String
fieldID: String! @search(by: [hash])
type: String! @search(by: [hash,regexp])
unit: String @search(by: [hash])
tandem: String
loopID: Int! @search
interlocks: [intAct!] @hasInverse(field: equip)
isDCSPoint: Boolean!
dcsGroup: [equipment!] @hasInverse(field: dcsGroup)
}
interface intAct {
id: ID!
equip: equipment @hasInverse(field: interlocks)
sessionID: Int
interlocks: [interlock] @hasInverse(field: actions)
type: intType!
}
type interlock {
id: ID!
fieldID: String! @search(by: [hash])
loopID: Int! @search
groupID: String
actions: [intAct!] @hasInverse(field: interlocks)
purpose: String!
description: String!
class: safetyLevel! @search(by: [hash])
safety: Boolean! @search
steps: String!
process: String!
vessel: String @search(by: [regexp])
unit: String @search(by: [hash])
testFreq: Int
testType: String
testStandard: String
procedureFile: [procedureFile] @hasInverse(field: interlocks)
sessionID: Int
funcCheck: funcCheckFile @hasInverse(field: interlock)
pha: phaNode @hasInverse(field: interlocks)
equalivent: [interlock!] @hasInverse(field: equalivent)
}
My schema is larger, but these are the relevant parts. I can’t include my data as this is a work project. An example of what happens is if I make xxx
xxx := ["ID1", "ID2", ..., "ID108", "ID109", "ID110"]
I only get the results for some of the ID’s (have not done extensive testing, but it seems to be the last ones that go missing. For example, I will get nothing back for “ID109” and “ID110”. However, if I run the same query with
xxx := ["ID108", "ID109", "ID110"]
I get back all the data I expect to be tied to all three elements. I say this to point out I know for sure the data is in the database. I have no idea why I don’t get all the results with the larger query