A pull query is a synchronous ksqlDB request that reads point-in-time results from a materialized store, returns them once, and then terminates. Unlike a push query, it does not keep streaming later changes to the client. section 11.1 section 11.3
Use a pull query when the caller needs an answer before continuing. It evaluates the current state rather than subscribing to updates; request it again to see newer results. Pull-query results are not shared, so identical requests from different clients execute separately. section 11.3 section 11.7
Choose among query styles by the result you need:
- Use a persistent query for continual server-side processing whose results are stored in a Kafka topic and can be consumed by multiple clients. section 11.3
- Use a push query for continual, client-directed updates without storing those returned results in a topic. section 11.3
- Use a pull query for a single current-state result in a synchronous request-response workflow. section 11.3
Look up an activity leader
Query the activity_leaders materialized table by key to retrieve Smith’s current row: SELECT last_name, activity, total_steps FROM activity_leaders WHERE key_1 = 'Smith'. The query returns once rather than emitting subsequent changes. section 11.3
Pull queries support a limited subset of SQL. Their query form selects items from a materialized table with a WHERE clause, while persistent queries can use the full ksqlDB SQL syntax. section 11.3 section 11.7
Figure 11.3 Pull queries return point-in-time results once; to get updates, you need to resubmit the query.
Compare a one-time pull result with a change subscription: updates require issuing the pull query again. section 11.3

