Skip to content

Commit

Permalink
HARMONY-1971: Address slow query for jobs+labels
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Jan 8, 2025
1 parent e9b3d3e commit fac0294
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/harmony/app/frontends/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function getJobsListing(
req.context.logger.info(`Get jobs listing for user ${req.user}`);
const root = getRequestRoot(req);
const { page, limit } = getPagingParams(req, env.defaultJobListPageSize);
const query: JobQuery = { where: {} };
const query: JobQuery = { where: {}, orderBy: { field: 'jobs.id', value: 'asc' } };
query.labels = req.body.label;

if (!req.context.isAdminAccess) {
Expand Down
2 changes: 1 addition & 1 deletion services/harmony/app/frontends/workflow-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function jobRenderingFunctions(logger: Logger, requestQuery: Record<string, any>
* @returns JobQuery
*/
function tableQueryToJobQuery(tableQuery: TableQuery, isAdmin: boolean, user: string, jobIDs?: string[]): JobQuery {
const jobQuery: JobQuery = { where: {}, whereIn: {} };
const jobQuery: JobQuery = { where: {}, whereIn: {}, orderBy: { field: 'jobs.id', value: 'desc' } };
if (tableQuery.sortGranules) {
jobQuery.orderBy = {
field: 'numInputGranules',
Expand Down

0 comments on commit fac0294

Please sign in to comment.