Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue with new stop place filtering logic #6482

Open
vpaturet opened this issue Feb 21, 2025 · 0 comments
Open

Performance issue with new stop place filtering logic #6482

vpaturet opened this issue Feb 21, 2025 · 0 comments
Labels
Bug Regression This feature is no longer working.

Comments

@vpaturet
Copy link
Contributor

vpaturet commented Feb 21, 2025

The new filtering logic on stop places and quays may lead to performance issues with queries that lack proper filtering.
This is a consequence of #6423

The filter on stop place ids:
"ids": []
used to be interpreted as: no id.
It is now interpreted as: all ids.

Whether this is a bug or not is debatable.
It can however significantly change the behavior and responsiveness of a production system.

Example:
The following query:

query stopPlaces($ids: [String!], $lines: [ID], $startTime: DateTime) {
  stopPlaces(
    ids: $ids
  ) {
    id
    name
    latitude
    longitude
    estimatedCalls(
      startTime: $startTime,
      timeRange: 72000,
      numberOfDepartures: 50,
      numberOfDeparturesPerLineAndDestinationDisplay: 5,
      arrivalDeparture: departures,
      includeCancelledTrips: true,
      whiteListed: {
        lines: $lines
      }
    ) {
      ...estimatedCallFields
    }
  }
}

fragment estimatedCallFields on EstimatedCall {
  quay {
    id
    publicCode
  }
  date
  aimedDepartureTime
  expectedDepartureTime
  destinationDisplay {
    frontText
    via
  }
  notices {
    text
  }
  situations {
    situationNumber
    reportType
  }
  serviceJourney {
    id
    journeyPattern {
      id
      line {
        id
        name
        publicCode
      }
    }
    transportMode
    transportSubmode
  }
  realtime
  cancellation
  predictionInaccurate
  occupancyStatus
}

used with the following parameters:

{
  "ids": [],
  "lines": [],
  "startTime": "2025-02-19T10:32:00.000Z"
}

will produce a very large response (round 280MB in the case of the Norwegian dataset)
The previous filtering logic would return en empty result set.

Version of OTP used (exact commit hash or JAR name)

latest dev-2.x

Data sets in use (links to GTFS and OSM PBF files)

Norwegian data.

@vpaturet vpaturet added Bug Regression This feature is no longer working. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Regression This feature is no longer working.
Projects
None yet
Development

No branches or pull requests

1 participant