TryGhost / TryGhost/NQL

Optimise sub queries

Open
#10 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement performance
Dominant language
JavaScript
Stars
7
Forks
7
Avg merge
9h 4m
Merged PRs (30d)
22

Description

mongo-knex generates for some cases multiple sub queries in the where clause e.g. for

$and: [{'tags.slug': 'en'}, {'tags.slug': 'de'}]

But there are some cases where we currently generate multiple sub queries, where we don't have to.

This issue should simply collect use cases over time to optimise the performance of the attached queries. I will leave a comment with a use case i discovered in a bit.

Just leave a comment if you discover or want to discuss a case 👍

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by documenting a concrete mongo-knex case that generates redundant subqueries, then compare the generated queries and use the collected cases to define when the optimization is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.