Ramesh Mahadevan

Ramesh Mahadevan

  • NA
  • 72
  • 12.6k

SQLite data base takes more timer to run inner join query

Jun 15 2020 8:51 PM
in the below query i'm returning only 50 rows but it is taking 15sec to execute. Index are already used.
 
any help?
  1. SELECT WP_TimerName, WP_WeldJobName, WP_Comment, WP_SpotName, WP_WeldJobVersion,  
  2. WP_LogNo, WP_TipWearCount, WP_TipDressCount, WP_UnixEpoch, WP_uirModeOff, WP_MonitorState, WP_MonitorErrorCode, WP_SpotRepetition,  
  3. WP_GhostRunMode, WP_GunName, WP_GunResistance, WP_TimerId, WP_CurrentMeasurementState, WP_VoltageMeasurementState, WP_ForceMeasurementState,  
  4. WP_PositionMeasurementState, WP_ContactWaitTime, SBP.Id SequenceBlock_Id, BP_SequenceBlockNo, BP_ForceOffset, BP_OffsetPosition, BP_SequenceBlockType, BP_UIP,  
  5. BP_FQF, BP_MeanCurrent, BP_MeanForce, BP_MeanPosition, BP_MeanPulse, BP_MeanResistance,  
  6. BP_MeanVoltage, BP_RegulationMode, BP_Energy, BP_GunResistance, WP_STCReference, WP_STCTeachName, BP_UIP, BP_CurrentCurve,  
  7. BP_VoltageCurve, BP_ForceCurve, BP_PulseCurve, BP_PositionCurve, BP_ScheduledBlockNo, BP_Length, BP_PSF, BP_spatterTime,  
  8. BP_TypeOrderNo , WP_ForceSensorScalFactor3 , WP_ForceSensorScalFactor2 , WP_ForceSensorScalFactor1 , WP_ForceSensorScalConstant ,  
  9. WP_PositionMeasurementState , BP_OffsetPosition ,BP_MeanPosition ,BP_PositionCurve ,BP_ReferenceCurveLength ,  
  10. BP_MonitorStdActualValue ,BP_MonitorStdReferenceValue ,BP_MonitorStdUpperToleranceBandPerc ,BP_Indentation ,BP_MonitorStdLowerToleranceBandPerc ,  
  11. BP_MeanTorque,BP_PQF  
  12. FROM WeldProtocol_Log_T WP  
  13. INNER JOIN  
  14. SequenceBlockProtocol_Log_T SBP  
  15. ON WP.Id = SBP.BP_WeldProtocol_Log_T_Id  
  16. WHERE 1=1  
  17. AND ((BP_SequenceBlockType=1 AND BP_TypeOrderNo=1))  
  18. ORDER BY  
  19. WP_UnixEpoch DESC,  
  20. WP_LogNo DESC  
  21. LIMIT 50 OFFSET 117050;  

Answers (2)