You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/sql.extensions/README.profiler.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ set term ;!
57
57
58
58
-- Start profiling
59
59
60
-
select rdb$profiler.start_session('Profile Session 1') from rdb$database;
60
+
select rdb$profiler.start_session('Profile Session 1', null, null, null, 'DETAILED_REQUESTS') from rdb$database;
61
61
62
62
set term !;
63
63
@@ -126,16 +126,20 @@ select pstat.*
126
126
127
127
`RDB$PROFILER.START_SESSION` starts a new profiler session, makes it the current session (of the given `ATTACHMENT_ID`) and returns its identifier.
128
128
129
-
If `FLUSH_INTERVAL` is different from`NULL`, auto-flush is setup in the same way as manually calling `RDB$PROFILER.SET_FLUSH_INTERVAL`.
129
+
If `FLUSH_INTERVAL` is different than`NULL`, auto-flush is setup in the same way as manually calling `RDB$PROFILER.SET_FLUSH_INTERVAL`.
130
130
131
131
If `PLUGIN_NAME` is `NULL` (the default), it uses the database configuration `DefaultProfilerPlugin`.
132
132
133
-
`PLUGIN_OPTIONS` are plugin specific options and currently should be `NULL` for `Default_Profiler` plugin.
133
+
`PLUGIN_OPTIONS` are plugin specific options and currently could be `NULL` or the string `DETAILED_REQUESTS` for `Default_Profiler` plugin.
134
+
135
+
When `DETAILED_REQUESTS` is used, `PLG$PROF_REQUESTS` will store detailed requests data, i.e., one record per each invocation of a statement. This may generate a lot of records, causing `RDB$PROFILER.FLUSH` to be slow.
136
+
137
+
When `DETAILED_REQUESTS` is not used (the default), `PLG$PROF_REQUESTS` stores an aggregated record per statement, using `REQUEST_ID = 0`.
134
138
135
139
Input parameters:
136
140
-`DESCRIPTION` type `VARCHAR(255) CHARACTER SET UTF8` default `NULL`
137
141
-`FLUSH_INTERVAL` type `INTEGER` default `NULL`
138
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
142
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
139
143
-`PLUGIN_NAME` type `VARCHAR(255) CHARACTER SET UTF8` default `NULL`
140
144
-`PLUGIN_OPTIONS` type `VARCHAR(255) CHARACTER SET UTF8` default `NULL`
141
145
@@ -151,14 +155,14 @@ Calling `RDB$PROFILER.PAUSE_SESSION(TRUE)` has the same semantics of calling `RD
151
155
152
156
Input parameters:
153
157
-`FLUSH` type `BOOLEAN NOT NULL` default `FALSE`
154
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
158
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
155
159
156
160
## Procedure `RESUME_SESSION`
157
161
158
162
`RDB$PROFILER.RESUME_SESSION` resumes the current profiler session (of the given `ATTACHMENT_ID`), if it was paused, so the next executed statements statistics are collected again.
159
163
160
164
Input parameters:
161
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
165
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
162
166
163
167
## Procedure `FINISH_SESSION`
164
168
@@ -170,7 +174,7 @@ Calling `RDB$PROFILER.FINISH_SESSION(TRUE)` has the same semantics of calling `R
170
174
171
175
Input parameters:
172
176
-`FLUSH` type `BOOLEAN NOT NULL` default `TRUE`
173
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
177
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
174
178
175
179
## Procedure `CANCEL_SESSION`
176
180
@@ -181,7 +185,7 @@ All session data present in the profiler plugin is discarded and will not be flu
181
185
Data already flushed is not deleted automatically.
182
186
183
187
Input parameters:
184
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
188
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
185
189
186
190
## Procedure `DISCARD`
187
191
@@ -190,7 +194,7 @@ Input parameters:
190
194
If there is a active session, it is cancelled.
191
195
192
196
Input parameters:
193
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
197
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
194
198
195
199
## Procedure `FLUSH`
196
200
@@ -203,7 +207,7 @@ Data is updated using an autonomous transaction, so if the procedure is called i
203
207
Once flush happens, finished sessions are removed from memory.
204
208
205
209
Input parameters:
206
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
210
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
207
211
208
212
## Procedure `SET_FLUSH_INTERVAL`
209
213
@@ -213,7 +217,7 @@ Input parameters:
213
217
214
218
Input parameters:
215
219
-`FLUSH_INTERVAL` type `INTEGER NOT NULL`
216
-
-`ATTACHMENT_ID` type `BIGINT NOT NULL`default`CURRENT_CONNECTION`
220
+
-`ATTACHMENT_ID` type `BIGINT` default `NULL`(meaning`CURRENT_CONNECTION`)
217
221
218
222
# Snapshot tables
219
223
@@ -267,34 +271,35 @@ Below is the list of tables that stores profile data.
267
271
## Table `PLG$PROF_REQUESTS`
268
272
269
273
-`PROFILE_ID` type `BIGINT` - Profile session ID
270
-
-`REQUEST_ID` type `BIGINT` - Request ID
271
274
-`STATEMENT_ID` type `BIGINT` - Statement ID
275
+
-`REQUEST_ID` type `BIGINT` - Request ID
276
+
-`CALLER_STATEMENT_ID` type `BIGINT` - Caller statement ID
272
277
-`CALLER_REQUEST_ID` type `BIGINT` - Caller request ID
273
278
-`START_TIMESTAMP` type `TIMESTAMP WITH TIME ZONE` - Moment this request was first gathered profile data
274
279
-`FINISH_TIMESTAMP` type `TIMESTAMP WITH TIME ZONE` - Moment this request was finished
275
280
-`TOTAL_ELAPSED_TIME` type `BIGINT` - Accumulated elapsed time (in nanoseconds) of the request
0 commit comments