~ihabunek/triglav

9de8220b05f7b6ed0906da06b0fd3c0c955f7ce4 — Ivan Habunek 1 year, 3 months ago 0766e50
Optimize query
1 files changed, 1 insertions(+), 1 deletions(-)

M lib/triglav/public_transport.ex
M lib/triglav/public_transport.ex => lib/triglav/public_transport.ex +1 -1
@@ 139,7 139,7 @@ defmodule Triglav.PublicTransport do
        SELECT route.id,
             count(*) FILTER (WHERE variant.id IS NOT NULL) AS matched_count,
             count(*) FILTER (WHERE variant.id IS NULL) AS unmatched_count,
             (SELECT count(*) FROM pt_route_variants WHERE route_id = route.id) AS total_count
             (SELECT count(*) FROM pt_route_variants WHERE feed_id = $1 AND route_id = route.id) AS total_count
        FROM pt_routes AS route
        LEFT JOIN pt_route_mapped_route_relations ON route_id = route.id
        LEFT JOIN pt_route_variants AS variant