Usage Scenarios
Scenario Description
GaussDB's streaming query mechanism processes results one by one rather than loading them all at once. It is designed for big data query scenarios with limited memory resources, such as big data export, offline analysis tasks, and pagination/on-demand loading. This mechanism helps prevent excessive memory consumption and potential memory overflow, ultimately enhancing processing speed.
Trigger Conditions
The JDBC connection parameter enableStreamingQuery is set to true. In addition, fetchSize is set to Integer.MIN_VALUE before the executeQuery method of Statement and PreparedStatement is called.
Impact on Services
Streaming query offers the following advantages:
- Low memory consumption: Streaming query significantly reduces the memory usage of applications.
- Fast response: Clients can start processing immediately upon receiving the first batch of data, without having to wait for the entire data set to be ready.
However, there are also associated risks:
- Prolonged connection occupation: Streaming query requires the database connection to remain open throughout the transmission of data streams. This prolonged connection occupation may result in connection pool depletion or other resource scheduling issues.
- Extended transaction duration: Transactions involving streaming queries may hold locks or MVCC snapshots for an extended period, increasing the probability of deadlocks or impacting write performance.
Applicable Versions
This applies only to GaussDB 505.1.0 and later versions.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot