I own an amount about 80 000 rows on 3 tables of database, every time I execute my code, it can take 4-5 minutes to display the result. Do you know if it's possible to reduce this time by adding whatever ?
def findAirportAndRunwayByCountry(code: String)(implicit session : DBSession = AutoSession) : List[(Airports,Runway)] = {
val (c, a, r) = (Country.syntax("c"), Airports.syntax("a"), Runway.syntax("r"))
withSQL { select.from(Airports as a).innerJoin(Runway as r).on(r.ID, a.ID).innerJoin(Country as c).on(c.Code, a.Country).where.eq(c.Code, code).or.like(c.Name, code + "%") }.map(rs => (Airports(rs),Runway(rs))).list.apply()
}
This is the code taking the time described (~4-5 mins)