mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-23 06:22:03 +08:00
Previously, the planner used a direct query via the SPI interface to retrieve metadata info needed for query planner functions like query rewriting. This commit updates the planner to use our caching system. This is a performance improvement for pretty much all operations, both data modifications and queries. For hypertables, this added a cache keyed by the main table OID and added negative entries (because the planner often needs to know if a table is /not/ a hypertable).
32 lines
677 B
SQL
32 lines
677 B
SQL
\set ON_ERROR_STOP 1
|
|
\set VERBOSITY verbose
|
|
\set SHOW_CONTEXT never
|
|
|
|
\o /dev/null
|
|
\ir include/insert_two_partitions.sql
|
|
\o
|
|
\set ECHO ALL
|
|
|
|
\c single
|
|
\d+ "_timescaledb_internal".*
|
|
|
|
-- Test that renaming hypertable is blocked
|
|
\set VERBOSITY default
|
|
\set ON_ERROR_STOP 0
|
|
ALTER TABLE "testNs" RENAME TO "newname";
|
|
\set ON_ERROR_STOP 1
|
|
|
|
-- Test that renaming ordinary table works
|
|
CREATE TABLE renametable (foo int);
|
|
ALTER TABLE "renametable" RENAME TO "newname";
|
|
SELECT * FROM "newname";
|
|
|
|
SELECT * FROM _timescaledb_catalog.hypertable;
|
|
DROP TABLE "testNs";
|
|
|
|
SELECT * FROM _timescaledb_catalog.hypertable;
|
|
\dt "public".*
|
|
\dt "_timescaledb_catalog".*
|
|
\dt+ "_timescaledb_internal".*
|
|
|