Skip to content

Commit

Permalink
add indices to temporary tables
Browse files Browse the repository at this point in the history
  • Loading branch information
leostera committed Nov 24, 2023
1 parent 9049395 commit 00baffa
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pool/app/filter/repo/repo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ module Sql = struct
let create_request ids =
Format.asprintf
{sql|
CREATE TEMPORARY TABLE tmp_invitations AS (
CREATE TEMPORARY TABLE tmp_invitations
(INDEX contact_index (contact_uuid),
INDEX experiment_index (experiment_uuid)
)
AS (
SELECT
pool_invitations.contact_uuid AS contact_uuid,
pool_invitations.experiment_uuid AS experiment_uuid
Expand Down Expand Up @@ -278,7 +282,11 @@ module Sql = struct
let create_request ids =
Format.asprintf
{sql|
CREATE TEMPORARY TABLE tmp_assignments AS (
CREATE TEMPORARY TABLE tmp_assignments
(INDEX contact_index (contact_uuid),
INDEX experiment_index (experiment_uuid)
)
AS (
SELECT
pool_assignments.contact_uuid AS contact_uuid,
pool_sessions.experiment_uuid AS experiment_uuid
Expand Down Expand Up @@ -317,7 +325,11 @@ module Sql = struct
let create_request ids =
Format.asprintf
{sql|
CREATE TEMPORARY TABLE tmp_participations AS (
CREATE TEMPORARY TABLE tmp_participations
(INDEX contact_index (contact_uuid),
INDEX experiment_index (experiment_uuid)
)
AS (
SELECT
pool_assignments.contact_uuid AS contact_uuid,
pool_sessions.experiment_uuid AS experiment_uuid
Expand Down

0 comments on commit 00baffa

Please sign in to comment.