Skip to content

Commit

Permalink
Merge pull request #678 from nasa/harmony-1971
Browse files Browse the repository at this point in the history
Harmony 1971 - Improve slow query for jobs+labels in jobs and workflow ui admin endpoints
  • Loading branch information
vinnyinverso authored Jan 8, 2025
2 parents e9b3d3e + 30a0239 commit 20471b6
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: 'desc' } };
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 20471b6

Please sign in to comment.