Issue
A SQL query is needed to determine the number of waveforms generated by each device in a PME system.
Product Line
Power Monitoring Expert 7.2.2
Power Monitoring Expert 8.2
Power Monitoring Expert 9.0
Power Monitoring Expert 2020
Power Monitoring Expert 2021
Power Monitoring Expert 2022
Power Monitoring Expert 2023
Power Monitoring Expert 2024
Environment
SQL Server Management Studio (SSMS)
Cause
When a database becomes too large, this can lead to performance issues within the software. Waveforms take up a considerable amount of storage. In order to begin analyzing the database storage composition, it is helpful to see the number of waveforms recorded by individual devices.
Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.*
Use the following SQL query:
use ION_Data
SELECT wl2.SourceID, s.Name as 'Source Name', COUNT(*) AS 'Number of Waveforms'
FROM WaveformLog2 wl2
inner join Source s on wl2.SourceID = s.ID
group by wl2.SourceID, s.name
order by 'number of waveforms' desc
Below is an example: