|
196 | 196 | - sql: |
|
197 | 197 | SELECT (SELECT pg_catalog.pg_get_userbyid(1))
|
198 | 198 | logical_plan: |-
|
199 |
| - LogicalProject { exprs: [pg_user.name] } |
| 199 | + LogicalProject { exprs: [rw_users.name] } |
200 | 200 | └─LogicalApply { type: LeftOuter, on: true, correlated_id: 1, max_one_row: true }
|
201 | 201 | ├─LogicalValues { rows: [[]], schema: Schema { fields: [] } }
|
202 |
| - └─LogicalProject { exprs: [pg_user.name] } |
| 202 | + └─LogicalProject { exprs: [rw_users.name] } |
203 | 203 | └─LogicalApply { type: LeftOuter, on: true, correlated_id: 2, max_one_row: true }
|
204 | 204 | ├─LogicalValues { rows: [[]], schema: Schema { fields: [] } }
|
205 |
| - └─LogicalProject { exprs: [pg_user.name] } |
206 |
| - └─LogicalFilter { predicate: (1:Int32 = pg_user.usesysid) } |
207 |
| - └─LogicalScan { table: pg_user, columns: [pg_user.usesysid, pg_user.name, pg_user.usecreatedb, pg_user.usesuper, pg_user.passwd] } |
| 205 | + └─LogicalProject { exprs: [rw_users.name] } |
| 206 | + └─LogicalFilter { predicate: (1:Int32 = rw_users.id) } |
| 207 | + └─LogicalShare { id: 2 } |
| 208 | + └─LogicalProject { exprs: [rw_users.id, rw_users.name, rw_users.create_db, rw_users.is_super, '********':Varchar] } |
| 209 | + └─LogicalScan { table: rw_users, columns: [rw_users.id, rw_users.name, rw_users.is_super, rw_users.create_db, rw_users.create_user, rw_users.can_login] } |
208 | 210 | optimized_logical_plan_for_batch: |-
|
209 | 211 | LogicalJoin { type: LeftOuter, on: true, output: all }
|
210 | 212 | ├─LogicalValues { rows: [[]], schema: Schema { fields: [] } }
|
211 | 213 | └─LogicalJoin { type: LeftOuter, on: true, output: all }
|
212 | 214 | ├─LogicalValues { rows: [[]], schema: Schema { fields: [] } }
|
213 |
| - └─LogicalScan { table: pg_user, output_columns: [pg_user.name], required_columns: [pg_user.name, pg_user.usesysid], predicate: (1:Int32 = pg_user.usesysid) } |
| 215 | + └─LogicalScan { table: rw_users, output_columns: [rw_users.name], required_columns: [rw_users.name, rw_users.id], predicate: (1:Int32 = rw_users.id) } |
214 | 216 | batch_plan: |-
|
215 | 217 | BatchNestedLoopJoin { type: LeftOuter, predicate: true, output: all }
|
216 | 218 | ├─BatchValues { rows: [[]] }
|
217 | 219 | └─BatchNestedLoopJoin { type: LeftOuter, predicate: true, output: all }
|
218 | 220 | ├─BatchValues { rows: [[]] }
|
219 |
| - └─BatchProject { exprs: [pg_user.name] } |
220 |
| - └─BatchFilter { predicate: (1:Int32 = pg_user.usesysid) } |
221 |
| - └─BatchScan { table: pg_user, columns: [pg_user.name, pg_user.usesysid], distribution: Single } |
| 221 | + └─BatchProject { exprs: [rw_users.name] } |
| 222 | + └─BatchFilter { predicate: (1:Int32 = rw_users.id) } |
| 223 | + └─BatchScan { table: rw_users, columns: [rw_users.name, rw_users.id], distribution: Single } |
222 | 224 | - sql: |
|
223 | 225 | SELECT n.nspname as "Schema",
|
224 | 226 | c.relname as "Name",
|
|
233 | 235 | AND pg_catalog.pg_table_is_visible(c.oid)
|
234 | 236 | ORDER BY 1,2;
|
235 | 237 | logical_plan: |-
|
236 |
| - LogicalProject { exprs: [pg_namespace.nspname, pg_class.relname, Case((pg_class.relkind = 'r':Varchar), 'table':Varchar, (pg_class.relkind = 'v':Varchar), 'view':Varchar, (pg_class.relkind = 'm':Varchar), 'materialized view':Varchar, (pg_class.relkind = 'i':Varchar), 'index':Varchar, (pg_class.relkind = 'S':Varchar), 'sequence':Varchar, (pg_class.relkind = 's':Varchar), 'special':Varchar, (pg_class.relkind = 't':Varchar), 'TOAST table':Varchar, (pg_class.relkind = 'f':Varchar), 'foreign table':Varchar, (pg_class.relkind = 'p':Varchar), 'partitioned table':Varchar, (pg_class.relkind = 'I':Varchar), 'partitioned index':Varchar) as $expr1, pg_user.name] } |
| 238 | + LogicalProject { exprs: [rw_schemas.name, pg_class.relname, Case((pg_class.relkind = 'r':Varchar), 'table':Varchar, (pg_class.relkind = 'v':Varchar), 'view':Varchar, (pg_class.relkind = 'm':Varchar), 'materialized view':Varchar, (pg_class.relkind = 'i':Varchar), 'index':Varchar, (pg_class.relkind = 'S':Varchar), 'sequence':Varchar, (pg_class.relkind = 's':Varchar), 'special':Varchar, (pg_class.relkind = 't':Varchar), 'TOAST table':Varchar, (pg_class.relkind = 'f':Varchar), 'foreign table':Varchar, (pg_class.relkind = 'p':Varchar), 'partitioned table':Varchar, (pg_class.relkind = 'I':Varchar), 'partitioned index':Varchar) as $expr1, rw_users.name] } |
237 | 239 | └─LogicalApply { type: LeftOuter, on: true, correlated_id: 1, max_one_row: true }
|
238 |
| - ├─LogicalFilter { predicate: In(pg_class.relkind, 'r':Varchar, 'p':Varchar, 'v':Varchar, 'm':Varchar, 'S':Varchar, 'f':Varchar, '':Varchar) AND (pg_namespace.nspname <> 'pg_catalog':Varchar) AND IsNull(RegexpMatch(pg_namespace.nspname, '^pg_toast':Varchar)) AND (pg_namespace.nspname <> 'information_schema':Varchar) } |
239 |
| - │ └─LogicalJoin { type: LeftOuter, on: (pg_namespace.oid = pg_class.relnamespace), output: all } |
| 240 | + ├─LogicalFilter { predicate: In(pg_class.relkind, 'r':Varchar, 'p':Varchar, 'v':Varchar, 'm':Varchar, 'S':Varchar, 'f':Varchar, '':Varchar) AND (rw_schemas.name <> 'pg_catalog':Varchar) AND IsNull(RegexpMatch(rw_schemas.name, '^pg_toast':Varchar)) AND (rw_schemas.name <> 'information_schema':Varchar) } |
| 241 | + │ └─LogicalJoin { type: LeftOuter, on: (rw_schemas.id = pg_class.relnamespace), output: all } |
240 | 242 | │ ├─LogicalScan { table: pg_class, columns: [pg_class.oid, pg_class.relname, pg_class.relnamespace, pg_class.relowner, pg_class.relkind, pg_class.relam, pg_class.reltablespace] }
|
241 |
| - │ └─LogicalScan { table: pg_namespace, columns: [pg_namespace.oid, pg_namespace.nspname, pg_namespace.nspowner, pg_namespace.nspacl] } |
242 |
| - └─LogicalProject { exprs: [pg_user.name] } |
243 |
| - └─LogicalFilter { predicate: (CorrelatedInputRef { index: 3, correlated_id: 1 } = pg_user.usesysid) } |
244 |
| - └─LogicalScan { table: pg_user, columns: [pg_user.usesysid, pg_user.name, pg_user.usecreatedb, pg_user.usesuper, pg_user.passwd] } |
| 243 | + │ └─LogicalShare { id: 2 } |
| 244 | + │ └─LogicalProject { exprs: [rw_schemas.id, rw_schemas.name, rw_schemas.owner, rw_schemas.acl] } |
| 245 | + │ └─LogicalScan { table: rw_schemas, columns: [rw_schemas.id, rw_schemas.name, rw_schemas.owner, rw_schemas.acl] } |
| 246 | + └─LogicalProject { exprs: [rw_users.name] } |
| 247 | + └─LogicalFilter { predicate: (CorrelatedInputRef { index: 3, correlated_id: 1 } = rw_users.id) } |
| 248 | + └─LogicalShare { id: 6 } |
| 249 | + └─LogicalProject { exprs: [rw_users.id, rw_users.name, rw_users.create_db, rw_users.is_super, '********':Varchar] } |
| 250 | + └─LogicalScan { table: rw_users, columns: [rw_users.id, rw_users.name, rw_users.is_super, rw_users.create_db, rw_users.create_user, rw_users.can_login] } |
245 | 251 | batch_plan: |-
|
246 |
| - BatchExchange { order: [pg_namespace.nspname ASC, pg_class.relname ASC], dist: Single } |
247 |
| - └─BatchProject { exprs: [pg_namespace.nspname, pg_class.relname, Case((pg_class.relkind = 'r':Varchar), 'table':Varchar, (pg_class.relkind = 'v':Varchar), 'view':Varchar, (pg_class.relkind = 'm':Varchar), 'materialized view':Varchar, (pg_class.relkind = 'i':Varchar), 'index':Varchar, (pg_class.relkind = 'S':Varchar), 'sequence':Varchar, (pg_class.relkind = 's':Varchar), 'special':Varchar, (pg_class.relkind = 't':Varchar), 'TOAST table':Varchar, (pg_class.relkind = 'f':Varchar), 'foreign table':Varchar, (pg_class.relkind = 'p':Varchar), 'partitioned table':Varchar, (pg_class.relkind = 'I':Varchar), 'partitioned index':Varchar) as $expr1, pg_user.name] } |
248 |
| - └─BatchSort { order: [pg_namespace.nspname ASC, pg_class.relname ASC] } |
249 |
| - └─BatchHashJoin { type: LeftOuter, predicate: pg_class.relowner = pg_user.usesysid, output: [pg_class.relname, pg_class.relkind, pg_namespace.nspname, pg_user.name] } |
| 252 | + BatchExchange { order: [rw_schemas.name ASC, pg_class.relname ASC], dist: Single } |
| 253 | + └─BatchProject { exprs: [rw_schemas.name, pg_class.relname, Case((pg_class.relkind = 'r':Varchar), 'table':Varchar, (pg_class.relkind = 'v':Varchar), 'view':Varchar, (pg_class.relkind = 'm':Varchar), 'materialized view':Varchar, (pg_class.relkind = 'i':Varchar), 'index':Varchar, (pg_class.relkind = 'S':Varchar), 'sequence':Varchar, (pg_class.relkind = 's':Varchar), 'special':Varchar, (pg_class.relkind = 't':Varchar), 'TOAST table':Varchar, (pg_class.relkind = 'f':Varchar), 'foreign table':Varchar, (pg_class.relkind = 'p':Varchar), 'partitioned table':Varchar, (pg_class.relkind = 'I':Varchar), 'partitioned index':Varchar) as $expr1, rw_users.name] } |
| 254 | + └─BatchSort { order: [rw_schemas.name ASC, pg_class.relname ASC] } |
| 255 | + └─BatchHashJoin { type: LeftOuter, predicate: pg_class.relowner = rw_users.id, output: [pg_class.relname, pg_class.relkind, rw_schemas.name, rw_users.name] } |
250 | 256 | ├─BatchExchange { order: [], dist: HashShard(pg_class.relowner) }
|
251 |
| - │ └─BatchHashJoin { type: Inner, predicate: pg_class.relnamespace = pg_namespace.oid, output: [pg_class.relname, pg_class.relowner, pg_class.relkind, pg_namespace.nspname] } |
| 257 | + │ └─BatchHashJoin { type: Inner, predicate: pg_class.relnamespace = rw_schemas.id, output: [pg_class.relname, pg_class.relowner, pg_class.relkind, rw_schemas.name] } |
252 | 258 | │ ├─BatchExchange { order: [], dist: HashShard(pg_class.relnamespace) }
|
253 | 259 | │ │ └─BatchFilter { predicate: In(pg_class.relkind, 'r':Varchar, 'p':Varchar, 'v':Varchar, 'm':Varchar, 'S':Varchar, 'f':Varchar, '':Varchar) }
|
254 | 260 | │ │ └─BatchScan { table: pg_class, columns: [pg_class.relname, pg_class.relnamespace, pg_class.relowner, pg_class.relkind], distribution: Single }
|
255 |
| - │ └─BatchExchange { order: [], dist: HashShard(pg_namespace.oid) } |
256 |
| - │ └─BatchFilter { predicate: (pg_namespace.nspname <> 'pg_catalog':Varchar) AND IsNull(RegexpMatch(pg_namespace.nspname, '^pg_toast':Varchar)) AND (pg_namespace.nspname <> 'information_schema':Varchar) } |
257 |
| - │ └─BatchScan { table: pg_namespace, columns: [pg_namespace.oid, pg_namespace.nspname], distribution: Single } |
258 |
| - └─BatchExchange { order: [], dist: HashShard(pg_user.usesysid) } |
259 |
| - └─BatchProject { exprs: [pg_user.name, pg_user.usesysid] } |
260 |
| - └─BatchScan { table: pg_user, columns: [pg_user.usesysid, pg_user.name], distribution: Single } |
| 261 | + │ └─BatchExchange { order: [], dist: HashShard(rw_schemas.id) } |
| 262 | + │ └─BatchFilter { predicate: (rw_schemas.name <> 'pg_catalog':Varchar) AND IsNull(RegexpMatch(rw_schemas.name, '^pg_toast':Varchar)) AND (rw_schemas.name <> 'information_schema':Varchar) } |
| 263 | + │ └─BatchScan { table: rw_schemas, columns: [rw_schemas.id, rw_schemas.name], distribution: Single } |
| 264 | + └─BatchExchange { order: [], dist: HashShard(rw_users.id) } |
| 265 | + └─BatchProject { exprs: [rw_users.name, rw_users.id] } |
| 266 | + └─BatchScan { table: rw_users, columns: [rw_users.id, rw_users.name], distribution: Single } |
261 | 267 | - sql: |
|
262 | 268 | create table auction (date_time date);
|
263 | 269 | select * from hop( auction, auction.date_time, INTERVAL '1', INTERVAL '3600' ) AS hop_1
|
|
0 commit comments