Clear expensive query problems
- Last UpdatedJan 13, 2023
- 2 minute read
- PI System
- PI Server
It is possible that an ODBC client application sends an incomplete query, or a query that returns too many results, to PI Server. When a query is timed out, it may or may not hold on to the server resource, mainly the virtual memory. If the timeout occurs during the query execution, the statement handle and its resource are freed. If the timeout occurs during the fetch, the statement handle is not freed. To clear the statement handle and its resource, shut down and restart the PI SQL Subsystem.
To do this, send a stop command to PI SQL Subsystem using one of the following methods:
-
From the Control Panel > Administrative Tools, run Services. Select PISQL Subsystem from the list and click Stop.
-
From a command prompt, enter:
net stop pisqlss
-
From a command prompt, enter:
\pi\bin\pisqlss -stop
A message is written to the message log indicating that PI SQL Subsystem has been stopped. Another message indicates the number of handles allocated and the number of handles aborted during the shutdown.
To restart PI SQL Subsystem and resume normal operation, use one of the following methods:
-
From the Control Panel > Administrative Tools, run Services. Select PISQL Subsystem from the list and click Start.
-
From a command-line prompt, enter:
net start pisqlss
-
From a command prompt, enter:
\pi\bin\pisqlss -start
A message is written to the message log indicating that PI SQL Subsystem has been continued.
Shutting down and restarting the subsystem can be done at any time and is equally effective. This is the only option available when running PI SQL Subsystem on Windows interactively.