Does adding more fields slow down a query significantly?

For the following two example queries, the complexity is the same. Does this mean that the querying time is not siginificantly different?

For example, if I do a “small” Purchase Order Query:

query
{
purchase_order (id: "SOME_ID") {
    request_id
    complexity
    data {
      id
      legacy_id
      po_number
      account_id
    line_items (first: 1){
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      node {
        po_number
        sku
        quantity
        quantity_received
        quantity_rejected
      }
      cursor
    }
  }
    }
}
}

Versus a “large” Purchase Order Query:

query
{
purchase_order (id: "SOME_ID") {
    request_id
    complexity
    data {
  id
  legacy_id
  po_number
  account_id
  warehouse_id
  vendor_id
  created_at
  po_date
  date_closed
  packing_note
  fulfillment_status
  po_note
  description
  subtotal
  discount
  total_price
  tax
  shipping_method
  shipping_carrier
  shipping_name
  shipping_price
  tracking_number
  pdf
  images
  payment_method
  payment_due_by
  payment_note
  locking
  locked_by_user_id
  line_items (first: 1){
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      node {
        po_id
        po_number
        sku
        quantity
        quantity_received
        quantity_rejected
        expected_weight_in_lbs
        note
        partner_line_item_id
        created_at
      }
      cursor
    }
  }
}
}
}

Does the large query take significantly longer? Or is it safe to assume they take the same time if the complexity is the same?

@tomasw or another dev, any update on this?

Hi @nturk!
I apologize for the delay in my response.
Yes, it is safe to assume that they take the same time if the complexity is the same; it shouldn’t take significantly longer.
What might influence this may be the connections (line_items in this example) if you don’t use first
Please let me know if there’s anything else I can help you with.
Thanks!
Tom

1 Like

Thanks Tom, that makes sense!