We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d9eef8 commit 7654c08Copy full SHA for 7654c08
src/graphql/operations/messages.ts
@@ -27,8 +27,9 @@ export default async function (parent, args) {
27
orderDirection = orderDirection.toUpperCase();
28
if (!['ASC', 'DESC'].includes(orderDirection)) orderDirection = 'DESC';
29
30
+ const useSpaceIndex = where.space ? 'USE INDEX (space)' : '';
31
const query = `
- SELECT m.* FROM messages m
32
+ SELECT m.* FROM messages m ${useSpaceIndex}
33
WHERE id IS NOT NULL ${queryStr}
34
ORDER BY ${orderBy} ${orderDirection} LIMIT ?, ?
35
`;
0 commit comments