Skip to main content
A DDL-based workspace derives database context from object definitions you provide. It is useful when the target database is unreachable, credentials cannot be shared, or the analysis scope is small and well defined.

Goal

Build a self-contained PawSQL workspace from table, view, constraint, and index definitions without a live database connection.

What to include

  • CREATE TABLE statements for every referenced table;
  • column names, data types, nullability, and defaults;
  • primary keys, unique constraints, and relevant foreign keys;
  • existing index definitions and key order;
  • view definitions used by the query;
  • schema-qualified object names where needed;
  • relevant partitioning or distribution definitions.
Table and column names may be enough for basic parsing, but metadata-dependent rewrites and index analysis often require types, constraints, and existing indexes.

Example

Use syntax valid for the actual target engine and version.

Create the workspace

With DDL as the source, create the workspace in these steps:
1

Create a workspace

Open workspace management in the correct organization or project, then enter a name and purpose.
2

Select engine and version

Match the DDL and target SQL.
3

Choose DDL as the source

Open the DDL input or upload flow.
4

Provide the definitions

Paste or upload current, sanitized DDL.
5

Review parsing

Inspect recognized schemas, objects, constraints, indexes, and failures.

Multiple schemas

When identical object names exist in multiple schemas:
  • qualify names in DDL;
  • set the appropriate default schema;
  • preserve the schema relationships used in production SQL;
  • test unqualified names explicitly.

Expected Result

After parsing completes, the workspace contains the recognized schemas, tables, columns, constraints, and indexes defined in the DDL, ready for SQL review and optimization.

Verification

Confirm the workspace was created correctly by checking that the DDL parsed without failures, referenced objects are resolved, and the recognized objects match the supplied definitions.

Limitations

A DDL-only workspace generally cannot provide live statistics, data distribution, database-generated plans, runtime validation, or objects omitted from the supplied definitions.
Do not invent a primary key, uniqueness constraint, or index to make analysis succeed. Incorrect metadata can change rewrite safety and recommendation quality.

Troubleshooting

Next steps

SQL optimization

Create from a database