|
0 min
37%
|
42 ms
|
242
imeagleangel
|
SELECT schemaname AS schema, t.relname AS table, ix.relname AS name, regexp_replace(pg_get_indexdef(i.indexrelid), $1, $2) AS columns, regexp_replace(pg_get_indexdef(i.indexrelid), $3, $4) AS using, indisunique AS unique, indisprimary AS primary, indisvalid AS valid, indexprs::text, indpred::text, pg_get_indexdef(i.indexrelid) AS definition FROM pg_index i INNER JOIN pg_class t ON t.oid = i.indrelid INNER JOIN pg_class ix ON ix.oid = i.indexrelid LEFT JOIN pg_stat_user_indexes ui ON ui.indexrelid = i.indexrelid WHERE schemaname IS NOT NULL ORDER BY 1, 2 /*pghero*/
|
|
0 min
18%
|
6 ms
|
791
imeagleangel
|
select
c.table_name as tn, c.column_name as cn, c.data_type as dt,
(CASE WHEN trg.trigger_name is NULL THEN $8 else $9 end) as au,
pk.constraint_type as ck,
c.character_maximum_length as clen,
c.numeric_precision as np,
c.numeric_scale as ns,
c.datetime_precision as dp,
c.ordinal_position as cop,
c.is_nullable as nrqd,
c.column_default as cdf,
c.generation_expression,
c.character_octet_length,
c.character_set_name as csn,
pk.ordinal_position as pk_ordinal_position,
pk.constraint_name as pk_constraint_name,
pk1.ordinal_position as pk_ordinal_position1,
pk1.constraint_name as pk_constraint_name1,
c.udt_name,
c.udt_schema,
c.is_identity as ii,
(SELECT count(*)
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc1
inner join INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cu
on cu.CONSTRAINT_NAME = tc1.CONSTRAINT_NAME
where
tc1.CONSTRAINT_TYPE = $10
and tc1.TABLE_NAME = c.TABLE_NAME
and cu.COLUMN_NAME = c.COLUMN_NAME
and tc1.TABLE_SCHEMA=c.TABLE_SCHEMA) is_unique,
(SELECT
string_agg(enumlabel, $11)
FROM "pg_enum" "e"
INNER JOIN "pg_type" "t" ON "t"."oid" = "e"."enumtypid"
INNER JOIN "pg_namespace" "n" ON "n"."oid" = "t"."typnamespace"
WHERE "n"."nspname" = c.udt_schema AND "t"."typname"=c.udt_name
) enum_values,
(SELECT t.typtype
FROM "pg_type" "t"
INNER JOIN "pg_namespace" "n" ON "n"."oid" = "t"."typnamespace"
WHERE "n"."nspname" = c.udt_schema AND "t"."typname"=c.udt_name
) udt_typtype
from information_schema.columns c
LEFT JOIN (
SELECT
kc.constraint_name,
kc.table_name,
kc.column_name,
kc.ordinal_position,
tc.constraint_type
FROM
information_schema.key_column_usage kc
INNER JOIN information_schema.table_constraints AS tc ON kc.constraint_name = tc.constraint_name
AND kc.constraint_schema = tc.constraint_schema
AND tc.constraint_type in($12)
WHERE
kc.table_catalog = $1
AND kc.table_schema = $2) pk1 ON pk1.table_name = c.table_name
AND pk1.column_name = c.column_name
left join
(
select
rel.relname AS table_name,
pc.conname as constraint_name,
col.attname as column_name,
pc.contype as constraint_type,
kc.ordinal_position as ordinal_position
from
pg_constraint pc
JOIN pg_namespace n
ON n.oid = pc.connamespace
INNER JOIN pg_catalog.pg_class rel
ON rel.oid = pc.conrelid
LEFT JOIN LATERAL UNNEST(pc.conkey) WITH ORDINALITY AS u(attnum, attposition) ON $13
LEFT JOIN pg_attribute col ON (col.attrelid = pc.conrelid AND col.attnum = u.attnum)
left join information_schema.key_column_usage as kc
on pc.conname = kc.constraint_name
and col.attname = kc.column_name
and kc.constraint_schema = n.nspname
and rel.relname = kc.table_name
WHERE n.nspname = $3
AND rel.relname = $4
and pc.contype = $14
) pk
on
pk.table_name = c.table_name and pk.column_name=c.column_name
left join information_schema.triggers trg on trg.event_object_table = c.table_name and trg.trigger_name = CONCAT($15 , $16 , $17 , c.column_name)
where c.table_catalog=$5 and c.table_schema=$6 and c.table_name=$7
order by c.table_name, c.ordinal_position
|
|
0 min
7%
|
0 ms
|
87,851
imeagleangel
|
select * from "nc_columns_v2" where (("deleted" = $1) or ("deleted" is null)) and "fk_workspace_id" = $2 and "base_id" = $3 and "id" = $4 limit $5
|
|
0 min
7%
|
0 ms
|
10,998
imeagleangel
|
select * from "nc_grid_view_columns_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "fk_view_id" = $3 order by "order" asc
Covered by index on (fk_view_id)
Rows: 7225
Row progression: 7225, 14
Row estimates
- fk_view_id (=): 14
- base_id (=): 1806
- fk_workspace_id (=): 7225
- order (sort): 185
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_column_id
- fk_view_id
- fk_view_id, fk_column_id
- id
|
|
0 min
4%
|
5 ms
|
232
imeagleangel
|
WITH query_stats AS ( SELECT LEFT(query, $1) AS query, queryid AS query_hash, rolname AS user, (total_time / $2 / $3) AS total_minutes, (total_time / calls) AS average_time, calls FROM pg_stat_statements INNER JOIN pg_database ON pg_database.oid = pg_stat_statements.dbid INNER JOIN pg_roles ON pg_roles.oid = pg_stat_statements.userid WHERE calls > $4 AND pg_database.datname = current_database() ) SELECT query, query AS explainable_query, query_hash, query_stats.user, total_minutes, average_time, calls, total_minutes * $5 / (SELECT SUM(total_minutes) FROM query_stats) AS total_percent, (SELECT SUM(total_minutes) FROM query_stats) AS all_queries_total_minutes FROM query_stats ORDER BY "total_minutes" DESC LIMIT $6 /*pghero*/
|
|
0 min
2%
|
3 ms
|
213
imeagleangel
|
SELECT n.nspname AS table_schema, c.relname AS table, attname AS column, format_type(a.atttypid, a.atttypmod) AS column_type, pg_get_expr(d.adbin, d.adrelid) AS default_value FROM pg_catalog.pg_attribute a INNER JOIN pg_catalog.pg_class c ON c.oid = a.attrelid INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace INNER JOIN pg_catalog.pg_attrdef d ON (a.attrelid, a.attnum) = (d.adrelid, d.adnum) WHERE NOT a.attisdropped AND a.attnum > $1 AND pg_get_expr(d.adbin, d.adrelid) LIKE $2 AND n.nspname NOT LIKE $3 /*pghero*/
|
|
0 min
2%
|
0 ms
|
8,870
imeagleangel
|
select * from "nc_grid_view_columns_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "id" = $3 limit $4
Covered by index on (id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- id (=): 1
- base_id (=): 1806
- fk_workspace_id (=): 7225
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_column_id
- fk_view_id
- fk_view_id, fk_column_id
- id
|
|
0 min
2%
|
0 ms
|
8,946
imeagleangel
|
insert into "nc_grid_view_columns_v2" ("base_id", "created_at", "fk_column_id", "fk_view_id", "fk_workspace_id", "id", "order", "show", "source_id", "updated_at", "width") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
0 min
1%
|
0 ms
|
8,220
imeagleangel
|
insert into "nc_columns_v2" ("ai", "au", "base_id", "cdf", "clen", "column_name", "cop", "created_at", "csn", "dt", "dtx", "dtxp", "dtxs", "fk_model_id", "fk_workspace_id", "id", "np", "ns", "order", "pk", "rqd", "source_id", "title", "uidt", "un", "unique", "updated_at") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27)
|
|
0 min
1%
|
0 ms
|
10,685
imeagleangel
|
SELECT
CASE WHEN $1 IN ($3, $4, $5) /* text, char, varchar */
THEN CASE WHEN $2 = $6 /* default typmod */
THEN CAST($7^$8 AS integer)
ELSE information_schema._pg_char_max_length($1, $2) *
pg_catalog.pg_encoding_max_length((SELECT encoding FROM pg_catalog.pg_database WHERE datname = pg_catalog.current_database()))
END
ELSE $9
END
|
|
0 min
1%
|
14 ms
|
22
imeagleangel
|
SELECT n.nspname AS schema, c.relname AS relation, CASE c.relkind WHEN $1 THEN $2 WHEN $3 then $4 ELSE $5 END AS type, pg_table_size(c.oid) AS size_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname NOT IN ($6, $7) AND n.nspname !~ $8 AND c.relkind IN ($9, $10, $11) ORDER BY pg_table_size(c.oid) DESC, 2 ASC /*pghero*/
|
|
0 min
0.8%
|
0 ms
|
8,946
imeagleangel
|
select max("order") as "order" from "nc_grid_view_columns_v2" where "fk_view_id" = $1 limit $2
Covered by index on (fk_view_id)
Rows: 7225
Row progression: 7225, 14
Row estimates
- fk_view_id (=): 14
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_column_id
- fk_view_id
- fk_view_id, fk_column_id
- id
|
|
0 min
0.8%
|
10 ms
|
22
imeagleangel
|
SELECT schemaname AS schema, relname AS table, indexrelname AS index, pg_relation_size(i.indexrelid) AS size_bytes, idx_scan as index_scans FROM pg_stat_user_indexes ui INNER JOIN pg_index i ON ui.indexrelid = i.indexrelid WHERE NOT indisunique AND idx_scan <= $1 ORDER BY pg_relation_size(i.indexrelid) DESC, relname ASC /*pghero*/
|
|
0 min
0.8%
|
54 ms
|
4
imeagleangel
|
select name, is_dst from pg_catalog.pg_timezone_names
union distinct
select abbrev as name, is_dst from pg_catalog.pg_timezone_abbrevs
|
|
0 min
0.7%
|
0 ms
|
8,946
imeagleangel
|
select * from "nc_columns_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "id" = $3 limit $4
Covered by index on (id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- id (=): 1
- base_id (=): 1806
- fk_workspace_id (=): 7225
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_model_id
- id
|
|
0 min
0.6%
|
10 ms
|
16
imeagleangel
|
SELECT schemaname AS schema, relname AS table, last_vacuum, last_autovacuum, last_analyze, last_autoanalyze, n_dead_tup AS dead_rows, n_live_tup AS live_rows FROM pg_stat_user_tables ORDER BY 1, 2 /*pghero*/
|
|
0 min
0.5%
|
1 ms
|
258
imeagleangel
|
SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
FROM pg_type as t
LEFT JOIN pg_range as r ON oid = rngtypid
WHERE
t.typname IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40)
|
|
0 min
0.5%
|
1 ms
|
213
imeagleangel
|
SELECT n.nspname AS schema, c.relname AS table, $1 - GREATEST(AGE(c.relfrozenxid), AGE(t.relfrozenxid)) AS transactions_left FROM pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_class t ON c.reltoastrelid = t.oid WHERE c.relkind = $2 AND ($3 - GREATEST(AGE(c.relfrozenxid), AGE(t.relfrozenxid))) < $4 ORDER BY 3, 1, 2 /*pghero*/
|
|
0 min
0.4%
|
0 ms
|
8,976
imeagleangel
|
select * from "nc_grid_view_columns_v2" where "id" = $1 limit $2
Covered by index on (id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- id (=): 1
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_column_id
- fk_view_id
- fk_view_id, fk_column_id
- id
|
|
0 min
0.4%
|
0 ms
|
8,955
imeagleangel
|
select * from "nc_columns_v2" where "id" = $1 limit $2
Covered by index on (id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- id (=): 1
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_model_id
- id
|
|
0 min
0.4%
|
0 ms
|
258
imeagleangel
|
SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
FROM pg_type as t
LEFT JOIN pg_range as r ON oid = rngtypid
WHERE
t.typelem IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48)
|
|
0 min
0.3%
|
0 ms
|
659
imeagleangel
|
select * from "nc_columns_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "fk_model_id" = $3 order by "order" asc
Covered by index on (fk_model_id)
Rows: 7225
Row progression: 7225, 14
Row estimates
- fk_model_id (=): 14
- base_id (=): 1806
- fk_workspace_id (=): 7225
- order (sort): 185
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_model_id
- id
|
|
0 min
0.2%
|
0 ms
|
13,608
imeagleangel
|
select $1[s], s - pg_catalog.array_lower($1,$2) + $3
from pg_catalog.generate_series(pg_catalog.array_lower($1,$4),
pg_catalog.array_upper($1,$5),
$6) as g(s)
|
|
0 min
0.2%
|
0 ms
|
258
imeagleangel
|
SELECT t.oid, t.typname
FROM pg_type as t
WHERE t.typname IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
0 min
0.2%
|
0 ms
|
658
imeagleangel
|
select * from "nc_grid_view_columns_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "fk_column_id" = $3
Covered by index on (fk_column_id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- fk_column_id (=): 1
- base_id (=): 1806
- fk_workspace_id (=): 7225
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_column_id
- fk_view_id
- fk_view_id, fk_column_id
- id
|
|
0 min
0.2%
|
0 ms
|
53,435
imeagleangel
|
SELECT CASE WHEN $2.typtype = $3 THEN $2.typbasetype ELSE $1.atttypid END
|
|
0 min
0.2%
|
0 ms
|
1,316
imeagleangel
|
update "nc_columns_v2" set "pv" = $1, "updated_at" = $2 where "id" = $3 and "fk_workspace_id" = $4 and "base_id" = $5
Covered by index on (id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- id (=): 1
- base_id (=): 1806
- fk_workspace_id (=): 7225
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_model_id
- id
|
|
0 min
0.2%
|
2 ms
|
22
imeagleangel
|
SELECT pg_database_size(current_database()) /*pghero*/
|
|
0 min
0.2%
|
0 ms
|
258
imeagleangel
|
SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
FROM pg_type as t
LEFT JOIN pg_range as r ON oid = rngtypid
WHERE
t.typtype IN ($1, $2, $3)
|
|
0 min
0.2%
|
0 ms
|
659
imeagleangel
|
insert into "nc_models_v2" ("base_id", "created_at", "fk_workspace_id", "id", "mm", "order", "source_id", "table_name", "title", "type", "updated_at") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
0 min
0.2%
|
0 ms
|
213
imeagleangel
|
SELECT n.nspname AS schema, c.relname AS sequence, has_sequence_privilege(c.oid, $1) AS readable FROM pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind = $2 AND n.nspname NOT IN ($3, $4) /*pghero*/
|
|
0 min
0.1%
|
0 ms
|
53,435
imeagleangel
|
SELECT CASE WHEN $2.typtype = $3 THEN $2.typtypmod ELSE $1.atttypmod END
|
|
0 min
0.1%
|
0 ms
|
658
imeagleangel
|
insert into "nc_views_v2" ("base_id", "created_at", "created_by", "expanded_record_mode", "fk_model_id", "fk_workspace_id", "id", "meta", "order", "owned_by", "show", "source_id", "title", "type", "updated_at") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)
|
|
0 min
0.1%
|
0 ms
|
642
imeagleangel
|
insert into "nc_columns_v2" ("ai", "au", "base_id", "cdf", "clen", "column_name", "cop", "created_at", "csn", "dt", "dtx", "dtxp", "dtxs", "fk_model_id", "fk_workspace_id", "id", "np", "ns", "order", "pk", "pv", "rqd", "source_id", "title", "uidt", "un", "unique", "updated_at") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28)
|
|
0 min
0.1%
|
0 ms
|
258
imeagleangel
|
SET SESSION timezone TO 'UTC'
|
|
0 min
0.1%
|
6 ms
|
5
imeagleangel
|
WITH query_stats AS ( SELECT LEFT(query, $1) AS query, queryid AS query_hash, rolname AS user, (total_time / $2 / $3) AS total_minutes, (total_time / calls) AS average_time, calls FROM pg_stat_statements INNER JOIN pg_database ON pg_database.oid = pg_stat_statements.dbid INNER JOIN pg_roles ON pg_roles.oid = pg_stat_statements.userid WHERE calls > $4 AND pg_database.datname = current_database() ) SELECT query, query AS explainable_query, query_hash, query_stats.user, total_minutes, average_time, calls, total_minutes * $5 / (SELECT SUM(total_minutes) FROM query_stats) AS total_percent, (SELECT SUM(total_minutes) FROM query_stats) AS all_queries_total_minutes FROM query_stats ORDER BY "average_time" DESC LIMIT $6 /*pghero*/
|
|
0 min
0.1%
|
0 ms
|
660
imeagleangel
|
insert into "nc_grid_view_v2" ("base_id", "created_at", "fk_view_id", "fk_workspace_id", "source_id", "updated_at") values ($1, $2, $3, $4, $5, $6)
|
|
0 min
0.1%
|
6 ms
|
5
imeagleangel
|
WITH query_stats AS ( SELECT LEFT(query, $1) AS query, queryid AS query_hash, rolname AS user, (total_time / $2 / $3) AS total_minutes, (total_time / calls) AS average_time, calls FROM pg_stat_statements INNER JOIN pg_database ON pg_database.oid = pg_stat_statements.dbid INNER JOIN pg_roles ON pg_roles.oid = pg_stat_statements.userid WHERE calls > $4 AND pg_database.datname = current_database() ) SELECT query, query AS explainable_query, query_hash, query_stats.user, total_minutes, average_time, calls, total_minutes * $5 / (SELECT SUM(total_minutes) FROM query_stats) AS total_percent, (SELECT SUM(total_minutes) FROM query_stats) AS all_queries_total_minutes FROM query_stats ORDER BY "calls" DESC LIMIT $6 /*pghero*/
|
|
0 min
< 0.1%
|
0 ms
|
659
imeagleangel
|
select * from "nc_models_v2" where (("type" = $1) or ("type" = $2)) and "fk_workspace_id" = $3 and "base_id" = $4 and "id" = $5 limit $6
|
|
0 min
< 0.1%
|
0 ms
|
213
imeagleangel
|
SELECT pid, state, application_name AS source, age(NOW(), COALESCE(query_start, xact_start)) AS duration, (wait_event IS NOT NULL) AS waiting, query, COALESCE(query_start, xact_start) AS started_at, EXTRACT($1 FROM NOW() - COALESCE(query_start, xact_start)) * $2 AS duration_ms, usename AS user, backend_type FROM pg_stat_activity WHERE state <> $3 AND pid <> pg_backend_pid() AND datname = current_database() AND NOW() - COALESCE(query_start, xact_start) > interval $4 AND query <> $5 ORDER BY COALESCE(query_start, xact_start) DESC /*pghero*/
|
|
0 min
< 0.1%
|
0 ms
|
16,504
imeagleangel
|
SELECT
CASE WHEN $2 = $3 /* default typmod */
THEN $4
WHEN $1 IN ($5, $6) /* char, varchar */
THEN $2 - $7
WHEN $1 IN ($8, $9) /* bit, varbit */
THEN $2
ELSE $10
END
|
|
0 min
< 0.1%
|
0 ms
|
659
imeagleangel
|
select * from "nc_views_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "fk_model_id" = $3 order by "order" asc
Covered by index on (fk_model_id)
Rows: 533
Row progression: 533, 1
Row estimates
- fk_model_id (=): 1
- base_id (=): 133
- fk_workspace_id (=): 533
- order (sort): 533
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- created_by
- fk_custom_url_id
- fk_model_id
- id
- owned_by
|
|
0 min
< 0.1%
|
0 ms
|
660
imeagleangel
|
select * from "nc_views_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "id" = $3 limit $4
Covered by index on (id)
Rows: 533
Row progression: 533, 1
Row estimates
- id (=): 1
- base_id (=): 133
- fk_workspace_id (=): 533
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- created_by
- fk_custom_url_id
- fk_model_id
- id
- owned_by
|
|
0 min
< 0.1%
|
0 ms
|
1,608
imeagleangel
|
select * from "nc_disabled_models_for_role_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "fk_view_id" = $3 and "role" = $4 limit $5
|
|
0 min
< 0.1%
|
0 ms
|
660
imeagleangel
|
select * from "nc_grid_view_v2" where "fk_workspace_id" = $1 and "base_id" = $2 and "fk_view_id" = $3 limit $4
Covered by index on (fk_view_id)
Rows: 533
Row progression: 533, 1
Row estimates
- fk_view_id (=): 1
- base_id (=): 133
- fk_workspace_id (=): 533
Existing indexes
- base_id, fk_view_id PRIMARY
- base_id, fk_workspace_id
- fk_view_id
- fk_view_id
|
|
0 min
< 0.1%
|
4 ms
|
4
imeagleangel
|
with T as ( select distinct
T.oid as table_id, T.relname as table_name
from pg_catalog.pg_class T
, pg_catalog.pg_attribute A
where T.relnamespace = $1::oid
and T.relkind in ($4, $5, $6, $7, $8)
and (pg_catalog.age(A.xmin) <= coalesce(nullif(greatest(pg_catalog.age($2::varchar::xid), $9), $10), $11) or pg_catalog.age(T.xmin) <= coalesce(nullif(greatest(pg_catalog.age($3::varchar::xid), $12), $13), $14))
and A.attrelid = T.oid
-- and T.relname in ( :[*f_names] )
)
select T.table_id,
C.attnum as column_position,
C.attname as column_name,
C.xmin as column_state_number,
C.atttypmod as type_mod,
C.attndims as dimensions_number,
pg_catalog.format_type(C.atttypid, C.atttypmod) as type_spec,
C.atttypid as type_id,
C.attnotnull as mandatory,
pg_catalog.pg_get_expr(D.adbin, T.table_id) /* D.adsrc */ as column_default_expression,
not C.attislocal as column_is_inherited,
C.attfdwoptions as options,
C.attisdropped as column_is_dropped,
C.attidentity /* null */ as identity_kind,
C.attgenerated /* null */ as generated
from T
join pg_catalog.pg_attribute C on T.table_id = C.attrelid
left join pg_catalog.pg_attrdef D on (C.attrelid, C.attnum) = (D.adrelid, D.adnum)
where attnum > $15
order by table_id, attnum
|
|
0 min
< 0.1%
|
1 ms
|
10
imeagleangel
|
select "id", "fk_model_id", "title", "uidt" as "type", "pk" as "primary_key", "pv" as "primary_value", "cdf" as "default_value", "system" as "is_system_field", "description", "order", "meta" from "nc_columns_v2" where "base_id" = $1 and "fk_workspace_id" = $2 and ("deleted" = $3 or "deleted" is null) order by "order" asc
|
|
0 min
< 0.1%
|
0 ms
|
10,685
imeagleangel
|
SELECT
CASE WHEN $1 IN ($3) /* date */
THEN $4
WHEN $1 IN ($5, $6, $7, $8) /* time, timestamp, same + tz */
THEN CASE WHEN $2 < $9 THEN $10 ELSE $2 END
WHEN $1 IN ($11) /* interval */
THEN CASE WHEN $2 < $12 OR $2 & $13 = $14 THEN $15 ELSE $2 & $16 END
ELSE $17
END
|
|
0 min
< 0.1%
|
0 ms
|
10,685
imeagleangel
|
SELECT
CASE $1
WHEN $3 /*int2*/ THEN $4
WHEN $5 /*int4*/ THEN $6
WHEN $7 /*int8*/ THEN $8
WHEN $9 /*numeric*/ THEN
CASE WHEN $2 = $10
THEN $11
ELSE (($2 - $12) >> $13) & $14
END
WHEN $15 /*float4*/ THEN $16 /*FLT_MANT_DIG*/
WHEN $17 /*float8*/ THEN $18 /*DBL_MANT_DIG*/
ELSE $19
END
|
|
0 min
< 0.1%
|
0 ms
|
659
imeagleangel
|
select * from "nc_models_v2" where "id" = $1 limit $2
Covered by index on (id)
Rows: 533
Row progression: 533, 1
Row estimates
- id (=): 1
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- base_id, type, parent_id, order
- id
- source_id
- type
- uuid
|
|
0 min
< 0.1%
|
0 ms
|
213
imeagleangel
|
SELECT state, COUNT(*) AS connections FROM pg_stat_activity GROUP BY 1 ORDER BY 2 DESC, 1 /*pghero*/
|
|
0 min
< 0.1%
|
0 ms
|
660
imeagleangel
|
select max("order") as "order" from "nc_views_v2" where "fk_model_id" = $1 limit $2
Covered by index on (fk_model_id)
Rows: 533
Row progression: 533, 1
Row estimates
- fk_model_id (=): 1
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- created_by
- fk_custom_url_id
- fk_model_id
- id
- owned_by
|
|
0 min
< 0.1%
|
0 ms
|
502
imeagleangel
|
select * from "nc_bases_v2" where "id" = $1 and "deleted" = $2 limit $3
|
|
0 min
< 0.1%
|
0 ms
|
381
imeagleangel
|
insert into "nc_disabled_models_for_role_v2" ("base_id", "created_at", "disabled", "fk_view_id", "fk_workspace_id", "id", "role", "source_id", "updated_at") values ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
|
0 min
< 0.1%
|
2 ms
|
6
imeagleangel
|
select D.objoid id, pg_catalog.array_agg(D.objsubid) sub_ids
from pg_catalog.pg_description D
join pg_catalog.pg_class C on D.objoid = C.oid
where C.relnamespace = $1::oid and C.relkind != $12 and D.classoid = $13::regclass
group by D.objoid
union all
select T.oid id, pg_catalog.array_agg(D.objsubid)
from pg_catalog.pg_description D
join pg_catalog.pg_type T on T.oid = D.objoid or T.typrelid = D.objoid
left join pg_catalog.pg_class C on T.typrelid = C.oid
where T.typnamespace = $2::oid and (C.relkind = $14 or C.relkind is null)
group by T.oid
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_constraint C on D.objoid = C.oid
where C.connamespace = $3::oid and D.classoid = $15::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_trigger T on T.oid = D.objoid
join pg_catalog.pg_class C on C.oid = T.tgrelid
where C.relnamespace = $4::oid and D.classoid = $16::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_rewrite R on R.oid = D.objoid
join pg_catalog.pg_class C on C.oid = R.ev_class
where C.relnamespace = $5::oid and D.classoid = $17::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_proc P on P.oid = D.objoid
where P.pronamespace = $6::oid and D.classoid = $18::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_operator O on O.oid = D.objoid
where O.oprnamespace = $7::oid and D.classoid = $19::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_opclass O on O.oid = D.objoid
where O.opcnamespace = $8::oid and D.classoid = $20::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_opfamily O on O.oid = D.objoid
where O.opfnamespace = $9::oid and D.classoid = $21::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_collation C on C.oid = D.objoid
where C.collnamespace = $10::oid and D.classoid = $22::regclass
union all
select D.objoid id, array[D.objsubid]
from pg_catalog.pg_description D
join pg_catalog.pg_policy P on P.oid = D.objoid
join pg_catalog.pg_class C on P.polrelid = C.oid
where C.relnamespace = $11::oid and D.classoid = $23::regclass
|
|
0 min
< 0.1%
|
3 ms
|
4
imeagleangel
|
create table "xc_knex_migrationsv0" ("id" serial primary key, "name" varchar(255), "batch" integer, "migration_time" timestamptz)
|
|
0 min
< 0.1%
|
0 ms
|
660
imeagleangel
|
select * from "nc_views_v2" where "id" = $1 limit $2
Covered by index on (id)
Rows: 533
Row progression: 533, 1
Row estimates
- id (=): 1
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- created_by
- fk_custom_url_id
- fk_model_id
- id
- owned_by
|
|
0 min
< 0.1%
|
0 ms
|
10,685
imeagleangel
|
SELECT
CASE WHEN $1 IN ($3, $4, $5) THEN $6
WHEN $1 IN ($7) THEN
CASE WHEN $2 = $8
THEN $9
ELSE ($2 - $10) & $11
END
ELSE $12
END
|
|
0 min
< 0.1%
|
11 ms
|
1
imeagleangel
|
ALTER TABLE "nc_doc_revisions_v2" ALTER COLUMN content TYPE jsonb USING content::jsonb
|
|
0 min
< 0.1%
|
3 ms
|
4
imeagleangel
|
/* xc */
CREATE TABLE "p88aeclvcjn51be"."Features" ( "id" serial, "created_at" timestamp NULL, "updated_at" timestamp NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "nc_order" numeric NULL, "__nc_deleted" boolean NULL, "nc_row_meta" jsonb NULL, "title" text NULL, PRIMARY KEY("id"))
|
|
0 min
< 0.1%
|
5 ms
|
2
imeagleangel
|
create table "nc_models_v2" ("id" varchar(20) not null, "source_id" varchar(20), "base_id" varchar(20), "table_name" varchar(255), "title" varchar(255), "type" varchar(255) default 'table', "meta" text, "schema" text, "enabled" boolean default '1', "mm" boolean default '0', "tags" varchar(255), "pinned" boolean, "deleted" boolean, "order" real, "description" text, "synced" boolean default '0', "fk_workspace_id" varchar(20), "created_by" varchar(20), "owned_by" varchar(20), "uuid" varchar(255), "password" varchar(255), "fk_custom_url_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_models_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
3 ms
|
4
imeagleangel
|
create table "nc_api_tokens" ("id" serial primary key, "base_id" varchar(20), "db_alias" varchar(255), "description" varchar(255), "permissions" text, "token" text, "expiry" varchar(255), "enabled" boolean default '1', "fk_user_id" varchar(20), "fk_workspace_id" varchar(20), "fk_sso_client_id" varchar(20), "created_at" timestamptz, "updated_at" timestamptz)
|
|
0 min
< 0.1%
|
5 ms
|
2
imeagleangel
|
create table "nc_bookmarks" ("id" varchar(20), "fk_user_id" varchar(20) not null, "fk_group_id" varchar(20) not null, "title" varchar(255) null default null, "target_type" varchar(20) not null, "target_id" varchar(128) not null, "icon" varchar(255) null default null, "icon_color" varchar(50) null default null, "icon_type" varchar(20) null default null, "order" real default '0', "meta" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_bookmarks_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
5 ms
|
2
imeagleangel
|
create table "nc_gantt_view_v2" ("fk_view_id" varchar(20) not null, "base_id" varchar(20), "source_id" varchar(20), "title" varchar(255), "meta" text, "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_gantt_view_v2_pkey" primary key ("base_id", "fk_view_id"))
|
|
0 min
< 0.1%
|
0 ms
|
76
imeagleangel
|
update "nc_grid_view_columns_v2" set "order" = $1, "updated_at" = $2 where "id" = $3 and "fk_workspace_id" = $4 and "base_id" = $5
Covered by index on (id)
Rows: 7225
Row progression: 7225, 1
Row estimates
- id (=): 1
- base_id (=): 1806
- fk_workspace_id (=): 7225
Existing indexes
- base_id, id PRIMARY
- base_id, fk_workspace_id
- fk_column_id
- fk_view_id
- fk_view_id, fk_column_id
- id
|
|
0 min
< 0.1%
|
0 ms
|
187
imeagleangel
|
SELECT last_value FROM "pjuezgotrxo40rf"."Features_id_seq" UNION ALL SELECT last_value FROM "public"."xc_knex_migrationsv0_id_seq" UNION ALL SELECT last_value FROM "public"."xc_knex_migrationsv0_lock_index_seq" UNION ALL SELECT last_value FROM "public"."nc_api_tokens_id_seq" UNION ALL SELECT last_value FROM "public"."nc_store_id_seq" UNION ALL SELECT last_value FROM "p88aeclvcjn51be"."Features_id_seq" /*pghero*/
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_record_templates" ("id" varchar(20) not null, "base_id" varchar(20) not null, "fk_workspace_id" varchar(20), "fk_model_id" varchar(20) not null, "title" varchar(255) not null, "description" text, "template_data" text not null, "usage_count" integer default '0', "enabled" boolean default '1', "created_by" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_record_templates_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_outline_view_v2" ("fk_view_id" varchar(20), "base_id" varchar(20), "source_id" varchar(128), "title" varchar(255), "show_empty_parents" boolean, "row_height" integer, "fk_prefix_column_id" varchar(20), "meta" text, "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_outline_view_v2_pkey" primary key ("base_id", "fk_view_id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_bases_v2" ("id" varchar(128), "title" varchar(255), "prefix" varchar(255), "status" varchar(255), "description" text, "meta" text, "color" varchar(255), "uuid" varchar(255), "password" varchar(255), "roles" varchar(255), "deleted" boolean default '0', "is_meta" boolean, "order" real, "type" varchar(200), "fk_workspace_id" varchar(20), "is_snapshot" boolean default '0', "fk_custom_url_id" varchar(20), "version" smallint default '2', "default_role" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_projects_v2_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_hooks_v2" ("id" varchar(20) not null, "source_id" varchar(20), "base_id" varchar(20), "fk_model_id" varchar(20), "title" varchar(255), "description" varchar(255), "env" varchar(255) default 'all', "type" varchar(255), "event" varchar(255), "operation" varchar(255), "async" boolean default '0', "payload" boolean default '1', "url" text, "headers" text, "condition" boolean default '0', "notification" text, "retries" integer default '0', "retry_interval" integer default '60000', "timeout" integer default '60000', "active" boolean default '1', "version" varchar(255), "trigger_field" boolean default '0', "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_hooks_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_col_long_text_v2" ("id" varchar(20) not null, "fk_workspace_id" varchar(20), "base_id" varchar(20), "fk_model_id" varchar(20), "fk_column_id" varchar(20), "fk_integration_id" varchar(20), "model" varchar(255), "prompt" text, "prompt_raw" text, "error" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_col_long_text_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_hook_logs_v2" ("id" varchar(20) not null, "source_id" varchar(20), "base_id" varchar(20), "fk_hook_id" varchar(20), "type" varchar(255), "event" varchar(255), "operation" varchar(255), "test_call" boolean default '1', "payload" text, "conditions" text, "notification" text, "error_code" varchar(255), "error_message" varchar(255), "error" text, "execution_time" integer, "response" text, "triggered_by" varchar(255), "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_hook_logs_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
8 ms
|
1
imeagleangel
|
alter table "nc_row_color_conditions" alter column "nc_order" type real using ("nc_order"::real)
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_col_formula_v2" ("id" varchar(20) not null, "fk_column_id" varchar(20), "formula" text not null, "formula_raw" text, "error" text, "deleted" boolean, "order" real, "parsed_tree" text, "base_id" varchar(20), "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_col_formula_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
2 ms
|
4
imeagleangel
|
select tab.oid table_id,
tab.relkind table_kind,
ind_stor.relname index_name,
ind_head.indexrelid index_id,
ind_stor.xmin state_number,
ind_head.indisunique is_unique,
ind_head.indisprimary is_primary,
/* ind_head.indnullsnotdistinct */$3 nulls_not_distinct,
pg_catalog.pg_get_expr(ind_head.indpred, ind_head.indrelid) as condition,
(select pg_catalog.array_agg(inhparent::bigint order by inhseqno)::varchar from pg_catalog.pg_inherits where ind_stor.oid = inhrelid) as ancestors,
ind_stor.reltablespace tablespace_id,
opcmethod as access_method_id
from pg_catalog.pg_class tab
join pg_catalog.pg_index ind_head
on ind_head.indrelid = tab.oid
join pg_catalog.pg_class ind_stor
on tab.relnamespace = ind_stor.relnamespace and ind_stor.oid = ind_head.indexrelid
left join pg_catalog.pg_opclass on pg_opclass.oid = ANY(indclass)
where tab.relnamespace = $1::oid
and tab.relkind in ($4, $5, $6, $7)
and ind_stor.relkind in ($8, $9)
-- and tab.relname in ( :[*f_names] )
and pg_catalog.age(ind_stor.xmin) <= coalesce(nullif(greatest(pg_catalog.age($2::varchar::xid), $10), $11), $12)
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_col_button_v2" ("id" varchar(20) not null, "base_id" varchar(20), "type" varchar(255), "label" text, "theme" varchar(255), "color" varchar(255), "icon" varchar(255), "formula" text, "formula_raw" text, "error" varchar(255), "parsed_tree" text, "fk_webhook_id" varchar(20), "fk_column_id" varchar(20), "fk_integration_id" varchar(20), "model" varchar(255), "output_column_ids" text, "fk_workspace_id" varchar(20), "fk_script_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_col_button_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
2 ms
|
4
imeagleangel
|
create table "nc_store" ("id" serial primary key, "base_id" varchar(255), "db_alias" varchar(255) default 'db', "key" varchar(255), "value" text, "type" varchar(255), "env" varchar(255), "tag" varchar(255), "created_at" timestamptz, "updated_at" timestamptz)
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "workspace_user" ("fk_workspace_id" varchar(20) not null, "fk_user_id" varchar(20) not null, "roles" varchar(255), "invite_token" varchar(255), "invite_accepted" boolean default '0', "deleted" boolean default '0', "deleted_at" timestamptz, "order" real, "invited_by" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "workspace_user_pkey" primary key ("fk_workspace_id", "fk_user_id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_oauth_clients" ("client_id" varchar(32), "client_secret" varchar(128), "client_type" varchar(255), "client_name" varchar(255), "client_description" text, "client_uri" varchar(255), "logo_uri" varchar(255), "redirect_uris" text, "allowed_grant_types" text, "response_types" text, "allowed_scopes" text, "registration_access_token" varchar(255), "registration_client_uri" varchar(255), "client_id_issued_at" bigint, "client_secret_expires_at" bigint, "fk_user_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_oauth_clients_pkey" primary key ("client_id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_table_syncs" ("id" varchar(20), "base_id" varchar(20), "fk_workspace_id" varchar(20) not null, "title" varchar(255) not null, "selected_fields" text, "on_delete_action" varchar(32), "sync_trigger" varchar(32), "status" varchar(16) default 'active', "last_error" text, "last_synced_at" timestamptz, "sync_job_id" varchar(255), "source_input_mode" varchar(16) not null default 'browse', "created_by" varchar(20), "updated_by" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_table_syncs_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_integrations_v2" ("id" varchar(20) not null, "title" varchar(128), "config" text, "meta" text, "type" varchar(20), "sub_type" varchar(20), "fk_workspace_id" varchar(20), "is_private" boolean default '0', "deleted" boolean default '0', "created_by" varchar(20), "order" real, "is_default" boolean default '0', "is_encrypted" boolean default '0', "is_global" boolean default '0', "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_integrations_v2_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_col_relations_v2" ("id" varchar(20) not null, "ref_db_alias" varchar(255), "type" varchar(255), "virtual" boolean, "db_type" varchar(255), "fk_column_id" varchar(20), "fk_related_model_id" varchar(20), "fk_child_column_id" varchar(20), "fk_parent_column_id" varchar(20), "fk_mm_model_id" varchar(20), "fk_mm_child_column_id" varchar(20), "fk_mm_parent_column_id" varchar(20), "ur" varchar(255), "dr" varchar(255), "fk_index_name" varchar(255), "deleted" boolean, "fk_target_view_id" varchar(20), "base_id" varchar(20), "fk_workspace_id" varchar(20), "fk_related_base_id" varchar(20), "fk_mm_base_id" varchar(20), "fk_related_source_id" varchar(20), "fk_mm_source_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_col_relations_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_sandboxes_v2" ("id" varchar(20), "fk_workspace_id" varchar(20) not null, "master_base_id" varchar(20) not null, "sandbox_base_id" varchar(20) not null, "created_by" varchar(20) not null, "meta" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_sandboxes_v2_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_installations" ("id" varchar(20) not null, "fk_subscription_id" varchar(20), "licensed_to" varchar(255) not null, "license_key" varchar(255) not null, "installation_secret" varchar(255), "installed_at" timestamptz, "last_seen_at" timestamptz, "expires_at" timestamptz, "license_type" varchar(255) not null, "status" varchar(255) not null default 'active', "seat_count" integer not null default '0', "config" text, "meta" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_installations_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_oauth_authorization_codes" ("code" varchar(32), "fk_client_id" varchar(32), "fk_user_id" varchar(20), "code_challenge" varchar(255), "code_challenge_method" varchar(10) default 'S256', "redirect_uri" varchar(255), "scope" varchar(255), "state" varchar(1024), "resource" varchar(255) null, "granted_resources" text null, "expires_at" timestamptz not null, "is_used" boolean not null default '0', "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_oauth_authorization_codes_pkey" primary key ("code"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_subscriptions" ("id" varchar(20) not null, "fk_workspace_id" varchar(20), "fk_org_id" varchar(20), "fk_plan_id" varchar(20) not null, "fk_user_id" varchar(20), "stripe_subscription_id" varchar(255), "stripe_price_id" varchar(255), "seat_count" integer not null default '1', "status" varchar(255), "billing_cycle_anchor" timestamptz, "start_at" timestamptz, "trial_end_at" timestamptz, "canceled_at" timestamptz, "period" varchar(255), "upcoming_invoice_at" timestamptz, "upcoming_invoice_due_at" timestamptz, "upcoming_invoice_amount" integer, "upcoming_invoice_currency" varchar(255), "stripe_schedule_id" varchar(255), "schedule_phase_start" timestamptz, "schedule_stripe_price_id" varchar(255), "schedule_fk_plan_id" varchar(20), "schedule_period" varchar(255), "schedule_type" varchar(255), "meta" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_subscriptions_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_extensions" ("id" varchar(20) not null, "base_id" varchar(20), "fk_user_id" varchar(20), "extension_id" varchar(255), "title" varchar(255), "kv_store" text, "meta" text, "order" real, "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_extensions_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_calendar_view_v2" ("fk_view_id" varchar(20) not null, "base_id" varchar(20), "source_id" varchar(20), "title" varchar(255), "fk_cover_image_col_id" varchar(20), "meta" text, "fk_workspace_id" varchar(20), "created_at" timestamptz, "updated_at" timestamptz, constraint "nc_calendar_view_v2_pkey" primary key ("base_id", "fk_view_id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_base_users_v2" ("base_id" varchar(20) not null, "fk_user_id" varchar(20) not null, "roles" text, "starred" boolean, "pinned" boolean, "group" varchar(255), "color" varchar(255), "order" real, "hidden" real, "opened_date" timestamptz, "invited_by" varchar(20), "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_base_users_v2_pkey" primary key ("base_id", "fk_user_id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_kanban_view_v2" ("fk_view_id" varchar(20) not null, "source_id" varchar(20), "base_id" varchar(20), "show" boolean, "order" real, "uuid" varchar(255), "title" varchar(255), "public" boolean, "password" varchar(255), "show_all_fields" boolean, "fk_grp_col_id" varchar(20), "fk_cover_image_col_id" varchar(20), "meta" text, "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_kanban_view_v2_pkey" primary key ("base_id", "fk_view_id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_sync_source_v2" ("id" varchar(20) not null, "title" varchar(255), "type" varchar(255), "details" text, "deleted" boolean, "enabled" boolean default '1', "order" real, "base_id" varchar(20), "fk_user_id" varchar(20), "source_id" varchar(20), "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_sync_source_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_columns_v2" ("id" varchar(20) not null, "source_id" varchar(20), "base_id" varchar(20), "fk_model_id" varchar(20), "title" varchar(255), "column_name" varchar(255), "uidt" varchar(255), "dt" varchar(255), "np" varchar(255), "ns" varchar(255), "clen" varchar(255), "cop" varchar(255), "pk" boolean, "pv" boolean, "rqd" boolean, "un" boolean, "ct" text, "ai" boolean, "unique" boolean, "cdf" text, "cc" text, "csn" varchar(255), "dtx" varchar(255), "dtxp" text, "dtxs" varchar(255), "au" boolean, "validate" text, "virtual" boolean, "deleted" boolean, "system" boolean default '0', "order" real, "meta" text, "description" text, "readonly" boolean default '0', "fk_workspace_id" varchar(20), "custom_index_name" varchar(64), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_columns_v2_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_mcp_tokens" ("id" varchar(20) not null, "title" varchar(512), "base_id" varchar(20), "token" varchar(32), "fk_workspace_id" varchar(20), "order" real, "fk_user_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_mcp_tokens_pkey" primary key ("base_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_gcp_marketplace_accounts" ("id" varchar(20) not null, "procurement_account_id" varchar(255) not null, "fk_user_id" varchar(20), "state" varchar(50) not null default 'pending', "link_token" varchar(64), "link_token_expires_at" timestamptz, "meta" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_gcp_marketplace_accounts_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_view_sections" ("id" varchar(20) not null, "fk_workspace_id" varchar(20), "base_id" varchar(20), "source_id" varchar(20), "fk_model_id" varchar(20) not null, "title" varchar(255) not null, "order" real, "meta" text, "created_by" varchar(20), "updated_by" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_view_sections_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
2 ms
|
4
imeagleangel
|
select D.objoid id, C.relkind::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_class C on D.objoid = C.oid
where C.relnamespace = $1::oid and C.relkind != $23 and D.classoid = $24::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($2::varchar::xid), $25), $26), $27)
-- all table-like things + seqs + iets anders?
union all
select T.oid id, $28::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_type T on T.oid = D.objoid or T.typrelid = D.objoid
left join pg_catalog.pg_class C on T.typrelid = C.oid
where T.typnamespace = $3::oid and (C.relkind = $29 or C.relkind is null)
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($4::varchar::xid), $30), $31), $32)
-- relkind = c (composite types?)
union all
select D.objoid id, pg_catalog.translate(C.contype, $33, $34)::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_constraint C on D.objoid = C.oid
where C.connamespace = $5::oid and D.classoid = $35::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($6::varchar::xid), $36), $37), $38)
-- table constraints
union all
select D.objoid id, $39::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_trigger T on T.oid = D.objoid
join pg_catalog.pg_class C on C.oid = T.tgrelid
where C.relnamespace = $7::oid and D.classoid = $40::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($8::varchar::xid), $41), $42), $43)
-- triggers
union all
select D.objoid id, $44::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_rewrite R on R.oid = D.objoid
join pg_catalog.pg_class C on C.oid = R.ev_class
where C.relnamespace = $9::oid and D.classoid = $45::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($10::varchar::xid), $46), $47), $48)
-- rules
union all
select D.objoid id, $49::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_proc P on P.oid = D.objoid
where P.pronamespace = $11::oid and D.classoid = $50::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($12::varchar::xid), $51), $52), $53)
-- more routines
union all
select D.objoid id, $54::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_operator O on O.oid = D.objoid
where O.oprnamespace = $13::oid and D.classoid = $55::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($14::varchar::xid), $56), $57), $58)
-- operators
union all
select D.objoid id, $59::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_opfamily O on O.oid = D.objoid
where O.opfnamespace = $15::oid and D.classoid = $60::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($16::varchar::xid), $61), $62), $63)
-- op families
union all
select D.objoid id, $64::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_opclass O on O.oid = D.objoid
where O.opcnamespace = $17::oid and D.classoid = $65::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($18::varchar::xid), $66), $67), $68)
-- op class
union all
select D.objoid id, $69::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_collation C on C.oid = D.objoid
where C.collnamespace = $19::oid and D.classoid = $70::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($20::varchar::xid), $71), $72), $73)
-- collations
union all
select D.objoid id, $74::char as kind, D.objsubid sub_id, D.description
from pg_catalog.pg_description D
join pg_catalog.pg_policy P on P.oid = D.objoid
join pg_catalog.pg_class C on P.polrelid = C.oid
where C.relnamespace = $21::oid and D.classoid = $75::regclass
and pg_catalog.age(D.xmin) <= coalesce(nullif(greatest(pg_catalog.age($22::varchar::xid), $76), $77), $78)
-- security policies (also by table name...)
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_chat_sessions" ("id" varchar(20) not null, "fk_workspace_id" varchar(20) not null, "fk_user_id" varchar(20), "title" varchar(255), "summary" text, "total_input_tokens" integer default '0', "total_output_tokens" integer default '0', "message_count" integer default '0', "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_chat_sessions_pkey" primary key ("fk_workspace_id", "id"))
|
|
0 min
< 0.1%
|
4 ms
|
2
imeagleangel
|
create table "nc_bookmark_groups" ("id" varchar(20), "fk_user_id" varchar(20) not null, "name" varchar(100) not null, "order" real default '0', "meta" text, "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_bookmark_groups_pkey" primary key ("id"))
|
|
0 min
< 0.1%
|
0 ms
|
213
imeagleangel
|
SELECT nsp.nspname AS schema, rel.relname AS table, con.conname AS name, fnsp.nspname AS referenced_schema, frel.relname AS referenced_table FROM pg_catalog.pg_constraint con INNER JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid LEFT JOIN pg_catalog.pg_class frel ON frel.oid = con.confrelid LEFT JOIN pg_catalog.pg_namespace nsp ON nsp.oid = con.connamespace LEFT JOIN pg_catalog.pg_namespace fnsp ON fnsp.oid = frel.relnamespace WHERE con.convalidated = $1 /*pghero*/
|
|
0 min
< 0.1%
|
3 ms
|
2
imeagleangel
|
create table "nc_user_comment_notifications_preference" ("id" varchar(20) not null, "row_id" varchar(255), "user_id" varchar(20), "fk_model_id" varchar(20), "source_id" varchar(20), "base_id" varchar(20), "preferences" varchar(255), "fk_workspace_id" varchar(20), "created_at" timestamptz not null default CURRENT_TIMESTAMP, "updated_at" timestamptz not null default CURRENT_TIMESTAMP, constraint "nc_user_comment_notifications_preference_pkey" primary key ("id"))
|