query -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- SELECT proto :: uuid, training :: INTEGER FROM lesson_listing WHERE type = $1 :: text AND lesson = $2 :: INT AND (level = $3 :: text OR level = 'any') ORDER BY orderc ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND training = $4 :: INT ORDER BY timestamp ASC DISCARD ALL SELECT id :: INT FROM modules WHERE course = $1 :: INT AND ((published_battle AND NOT $2 :: bool) OR (published_stage AND $2 :: bool)) ORDER BY orderc, id DISCARD ALL SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT COALESCE (COALESCE (surname, name), public_id) :: text FROM users WHERE id = $1 :: uuid SELECT level :: text, style :: text FROM default_level_style WHERE course = $1 :: INTEGER SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC DISCARD ALL DISCARD ALL SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT COALESCE (COALESCE (surname, name), public_id) :: text FROM users WHERE id = $1 :: uuid DISCARD ALL SELECT name :: text, (SELECT teacher FROM course_recommendations r WHERE EXISTS (SELECT * FROM students WHERE class = r.class AND student = COALESCE ($2 :: uuid, uuid_nil())) AND $1 :: INT = course LIMIT 1) :: uuid FROM courses WHERE id = $1 :: INT SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND training = $4 :: INT ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT public_id :: text, role :: text, name :: text, surname :: text, patronym :: text, email :: text, mesh_id :: text, mesh_actor :: text, login :: text, confirmed :: bool, (SELECT count(*) FROM support.tickets WHERE created_by = $1 :: uuid AND user_has_unseen) :: INT FROM users WHERE id = $1 :: uuid DISCARD ALL DISCARD ALL SELECT course :: INTEGER FROM lessons WHERE id = $1 :: INTEGER SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC DISCARD ALL DISCARD ALL DISCARD ALL DISCARD ALL SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC DISCARD ALL SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND training = $4 :: INT ORDER BY timestamp ASC DISCARD ALL SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND prototype = $4 :: uuid ORDER BY timestamp ASC SELECT id :: uuid, solved :: bool, changed :: bool, hint_shown :: bool, solution_shown :: bool, clone :: uuid, answer :: jsonb, result :: jsonb, action :: text, timestamp :: timestamptz, rating :: DOUBLE PRECISION FROM attempt_stats WHERE part = $1 :: text AND student = $2 :: uuid AND lesson = $3 :: INT AND training = $4 :: INT ORDER BY timestamp ASC DISCARD ALL (41 rows)