Skip to content

Commit 8c31491

Browse files
committed
Add indexes to log tables
1 parent 15ca56b commit 8c31491

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

main/SQLHelper.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,24 @@ bool CSQLHelper::OpenDatabase()
676676
query(sqlCreateMySensorsVariables);
677677
query(sqlCreateMySensorsChilds);
678678
query(sqlCreateToonDevices);
679+
//Add indexes to log tables
680+
query("create index if not exists f_idx on Fan(DeviceRowID);");
681+
query("create index if not exists fc_idx on Fan_Calendar(DeviceRowID);");
682+
query("create index if not exists l_idx on LightingLog(DeviceRowID);");
683+
query("create index if not exists m_idx on Meter(DeviceRowID);");
684+
query("create index if not exists mc_idx on Meter_Calendar(DeviceRowID);");
685+
query("create index if not exists mm_idx on MultiMeter(DeviceRowID);");
686+
query("create index if not exists mmc_idx on MultiMeter_Calendar(DeviceRowID);");
687+
query("create index if not exists p_idx on Percentage(DeviceRowID);");
688+
query("create index if not exists pc_idx on Percentage_Calendar(DeviceRowID);");
689+
query("create index if not exists r_idx on Rain(DeviceRowID);");
690+
query("create index if not exists rc_idx on Rain_Calendar(DeviceRowID);");
691+
query("create index if not exists t_idx on Temperature(DeviceRowID);");
692+
query("create index if not exists tc_idx on Temperature_Calendar(DeviceRowID);");
693+
query("create index if not exists u_idx on UV(DeviceRowID);");
694+
query("create index if not exists uv_idx on UV_Calendar(DeviceRowID);");
695+
query("create index if not exists w_idx on Wind(DeviceRowID);");
696+
query("create index if not exists wc_idx on Wind_Calendar(DeviceRowID);");
679697

680698
if ((!bNewInstall) && (dbversion < DB_VERSION))
681699
{

0 commit comments

Comments
 (0)