Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
First stab at improving order by performance
Browse files Browse the repository at this point in the history
At the moment, it's not quite clear to me how to run the tests locally.
I will let the build server run the tests for now and I hope to see some
tests failing that would give me some direction.

@johnymontana @jexp @michaeldgraham I would be very glad if you could
help me out on how to run tests locally and what test cases you would
expect to see.

This commit is still work-in-progress.
  • Loading branch information
roschaefer committed May 24, 2019
1 parent 7b44e18 commit 04dfa08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,14 @@ const nodeQuery = ({

const predicate = predicateClauses ? `WHERE ${predicateClauses} ` : '';

const orderByClause = orderByValue
? `WITH ${safeVariableName} ${orderByValue}`
: '';
let query =
`MATCH (${safeVariableName}:${safeLabelName}${
argString ? ` ${argString}` : ''
}) ${predicate}` +
`RETURN ${safeVariableName} {${subQuery}} AS ${safeVariableName}${orderByValue}${outerSkipLimit}`;
`${orderByClause} RETURN ${safeVariableName} {${subQuery}} AS ${safeVariableName}${outerSkipLimit}`;

return [query, params];
};
Expand Down

0 comments on commit 04dfa08

Please sign in to comment.