Query 1
Query a board for its items without any column values.
query ($boardId: [Int]) {
boards(ids: $boardId) {
items {
id
}
}
complexity {
query
}
}
complexity: 1020
Query 2
Taking the results of Query 1 Items array and passing it as $itemsIds
query ($itemIds: [Int], $columnId: [String]) {
items (ids: $itemIds) {
id
column_values(ids: $columnId) {
value
}
}
complexity {
query
}
}
Complexity 46
Query 3
Query board returning column values - this is a combination of 1 & 2 above.
query ($boardId: [Int], $columnId: [String]) {
boards(ids: $boardId) {
items {
id
column_values(ids: $columnId) {
value
}
}
}
complexity {
query
}
}
Complexity 12020
By doing query 1 and passing the results to query 2, the cost is a combined total of 1066. By doing just query 3 - the cost is 12020 - 11.27X more complex, for what I think is the same number of objects handled.
I realize the boards query to get items is expensive because its a search of item documents for that board ID (query 1). But once that’s done, the item documents are found and the column values retrieved from them. That’s second part is the same as what’s happening in Query 2 which cost 46, but now is 11000 more to get the column values vs 46. I could see a bit of an increase, but this is orders of magnitude more. Its seems like since getting the list of items from the board (all) is a search of the database and that has a cost multiplier - that multiplier is then being applied to the sub-queries to get the items themselves when it shouldn’t be.