summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-04-09 11:32:35 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-09 12:05:55 +0200
commit7e84da5fef77ffaa1b7462b7eb647e48d8c5613c (patch)
tree97d39c9e92a7b56714536817efa89c4cd35dd4fa
parent82121de9dff59ed0b18096d5416d7e6738ddf2ca (diff)
Optimize: Only load the job ids from the DB in the first place
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r--src/commands/db.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/commands/db.rs b/src/commands/db.rs
index d8669aa..a8d8b3c 100644
--- a/src/commands/db.rs
+++ b/src/commands/db.rs
@@ -331,9 +331,8 @@ fn jobs(conn_cfg: DbConnectionConfig, matches: &ArgMatches) -> Result<()> {
.and(schema::envvars::dsl::value.eq(val))
})
.inner_join(schema::job_envs::table)
- .select(schema::job_envs::all_columns)
- .load::<models::JobEnv>(&conn)
- .map(|jobenvs| jobenvs.into_iter().map(|je| je.job_id).collect::<Vec<_>>())?;
+ .select(schema::job_envs::job_id)
+ .load::<i32>(&conn)?;
sel.filter(schema::jobs::dsl::id.eq_any(jids))
} else {