فهرست منبع

add fetch index for isFPU and isManual to improve fetch times from the database

polscm32 2 سال پیش
والد
کامیت
6feb2256a8

+ 1 - 1
FreeAPS.xcodeproj/xcshareddata/xcschemes/FreeAPS X.xcscheme

@@ -67,7 +67,7 @@
          </CommandLineArgument>
          <CommandLineArgument
             argument = "-com.apple.CoreData.SQLDebug 1"
-            isEnabled = "NO">
+            isEnabled = "YES">
          </CommandLineArgument>
       </CommandLineArguments>
       <EnvironmentVariables>

+ 6 - 0
Model/Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents

@@ -17,6 +17,9 @@
         <fetchIndex name="byDate">
             <fetchIndexElement property="date" type="Binary" order="ascending"/>
         </fetchIndex>
+        <fetchIndex name="byIsFPU">
+            <fetchIndexElement property="isFPU" type="Binary" order="ascending"/>
+        </fetchIndex>
     </entity>
     <entity name="Forecast" representedClassName="Forecast" syncable="YES">
         <attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
@@ -42,6 +45,9 @@
         <fetchIndex name="byDate">
             <fetchIndexElement property="date" type="Binary" order="descending"/>
         </fetchIndex>
+        <fetchIndex name="byIsManual">
+            <fetchIndexElement property="isManual" type="Binary" order="ascending"/>
+        </fetchIndex>
     </entity>
     <entity name="HbA1c" representedClassName="HbA1c" syncable="YES">
         <attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>