Skip to content

Commit

Permalink
Add more timings to help debug
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed Nov 4, 2024
1 parent 1984aa7 commit 34ba4a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function create_internal_structures(connection)

graph = MetaGraphsNext.MetaGraph(_graph, asset_data, flow_data, nothing, nothing, nothing)

tmp_create_partition_tables(connection)
@timeit to "Create partition tables" tmp_create_partition_tables(connection)
df = TulipaIO.get_table(connection, "asset_time_resolution")
gdf = DataFrames.groupby(df, [:asset, :year, :rep_period])
for ((a, year, rp), _df) in pairs(gdf)
Expand Down
2 changes: 1 addition & 1 deletion src/model-preparation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function construct_dataframes(
dataframes[key] = df
end

tmp_create_constraints_indices(connection)
@timeit to "Create constraints indices" tmp_create_constraints_indices(connection)

# WIP: Can these queries be left undordered by the end of the refactor?
# WIP: highest_in_out is not included in constraints_partition anymore
Expand Down
8 changes: 4 additions & 4 deletions src/tmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function tmp_example_of_flow_expression_problem()
end

function tmp_create_expressions(connection)
DuckDB.execute(
@timeit to "Create t_incoming_nonzero" DuckDB.execute(
connection,
"CREATE OR REPLACE TABLE t_incoming_nonzero AS
SELECT
Expand All @@ -340,7 +340,7 @@ function tmp_create_expressions(connection)
WHERE duration > 0",
)

DuckDB.execute(
@timeit to "Create t_outgoing_nonzero" DuckDB.execute(
connection,
"CREATE OR REPLACE TABLE t_outgoing_nonzero AS
SELECT
Expand All @@ -361,7 +361,7 @@ function tmp_create_expressions(connection)
WHERE duration > 0",
)

DuckDB.execute(
@timeit to "Create highest_in_out_incoming" DuckDB.execute(
connection,
"CREATE OR REPLACE TABLE highest_in_out_incoming AS
SELECT
Expand All @@ -387,7 +387,7 @@ function tmp_create_expressions(connection)
",
)

DuckDB.execute(
@timeit to "Create highest_in_out_outgoing" DuckDB.execute(
connection,
"CREATE OR REPLACE TABLE highest_in_out_outgoing AS
SELECT
Expand Down

0 comments on commit 34ba4a1

Please sign in to comment.