VALUES Scan
Description
Reads the list of values specified in the VALUES clause and returns it as a set of virtual rows to the query planner. These virtual rows can be used by other scanners or operators, such as hash join or merge join.
Typical Scenarios
This operator provides a quick and simple way to specify a set of values without reading data from a table. This is useful during testing or debugging, or when you need to insert a small amount of data.
Examples
The insert statement contains VALUES.
-- Prepare data. gaussdb=#CREATE TABLE test_b (c1 number); CREATE TABLE -- Execution result. gaussdb=#EXPLAIN INSERT INTO test_b(c1) VALUES ('1'),('2'); QUERY PLAN -------------------------------------------------------------------------------- Streaming (type: GATHER) (cost=0.12..2.21 rows=1 width=32) Node/s: All datanodes -> Insert on test_b (cost=0.00..2.11 rows=4 width=32) -> Streaming(type: REDISTRIBUTE) (cost=0.00..0.11 rows=4 width=32) Spawn on: datanode2 -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=4 width=32) (6 rows) -- Drop the table. gaussdb=#DROP TABLE test_b;
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