Menu

1 / 2

1.1.2 Simple vs Extended

DEV Community·JoongHyuk Shin·6 months ago
#mmwqmywL
#capability#postgres#database#internals#plan
Reading 0:00
15s threshold

The fork visible in 1.1.1 (simple query protocol on one side, extended on the other) is the subject of this section, one level deeper. 1.1.1 set the skeleton: simple is one message, extended is four. The job here is to show how that split translates into four distinct outcomes: plan reuse, parameter safety, pipelining, and error handling.

Message sequence: the shape of one cycle is different

Putting the message sequences side by side makes the difference visible at a glance.

Simple :

Client Server │ │ │── 'Q' (SQL text) ────────────▶│ │ │ parse → analyze/rewrite → plan │ │ → create portal → execute → drop portal │◀── RowDescription, DataRow*, CommandComplete, ReadyForQuery

Enter fullscreen mode

Exit fullscreen mode

Extended :

Client Server │ │ │── 'P' (SQL template) ────────▶│ parse + analyze, store prepared statement │◀── ParseComplete │ │ │── 'B' (parameter values) ────▶│ choose plan, create portal │◀── BindComplete │ │ │── 'E' (execute) ─────────────▶│ run portal, send rows │◀── DataRow*,…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.