Skip to content

Thousands of SQL queries when opening CreateElement in a browser

Opening https://arkindex.teklia.com/api/v1/elements/create/ in a browser causes thousands of SQL queries to fill up the HTML form:

  • 1 query for up to 1000 corpora
  • 1 query for up to 1000 elements (including those that should not be accessible)
  • 1 query per element type of every element, up to 1000
  • 1 query for up to 1000 worker versions
  • 1 query per worker from those worker versions
  • 1 query per revision from those worker versions
  • 1 query for up to 1000 images

In the worst case, this can cause 3004 useless SQL queries.

Edited by Erwan Rouchet