cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.04k stars 622 forks source link

[15721]Temporary table #1342

Closed yjc408 closed 6 years ago

yjc408 commented 6 years ago

This branch contains our work for the temporary table feature.

We integrated our work with the schema (namespace) feature added by Mengran. Now the temporary table is supported with schema similar to what's in Postgres.

How temporary table is supported: when a session starts, a temporary schema name for that session is generated and a schema is created with this name. If there is a request with schema name unspecified, Peloton will search under the temporary schema created for that session first and then search under the public schema if it doesn't exist with the temporary schema. Furthermore, if the user want to access a table created under the public schema, it can do so with specifying public schema explicitly. When a session ends, all the table created under the temporary session schema are dropped and the schema itself will also be dropped.

Major Files to look at: binder: bind_node_visitor.cpp, binder_context.cpp catalog: catalog.cpp, table_catalog.cpp, database_catalog.cpp Parser: sql_statement, create_statement, postgresparser Planner: create_plan, drop_plan, Optimizer: optimizer, query_to_operator_transformer Traffic_cop: traffic_cop network: connection_handler, postgres_connection_handler.

apavlo commented 6 years ago

We are not going to merge this. It will require a major rewrite.