mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-09-11 01:25:24 +02:00
13 lines
793 B
TeX
13 lines
793 B
TeX
\subsection{SQL}
|
|
DuckDB (and PostgreSQL) features an \texttt{EXPLAIN} and \texttt{EXPLAIN ANALYZE} query,
|
|
pretty-printing the query plan and pretty-printing the query plan and profiling the query execution, respectively
|
|
|
|
A few useful commands for debugging and writing queries (for DuckDB and PostgreSQL via \texttt{psql} CLI):
|
|
\begin{tables}{p{4cm}p{4cm}p{8cm}}{DuckDB & PostgreSQL & Description}
|
|
\texttt{SHOW TABLES;} & \verb|\dt| & Show all tables \\
|
|
\texttt{SHOW tablename;} & \verb|\d tablename| & Show schema of table \texttt{tablename} \\
|
|
\end{tables}
|
|
Note that \texttt{SHOW} and \texttt{DESCRIBE} are aliases in DuckDB. They can also be used on queries!.
|
|
|
|
To see all \texttt{psql} commands, run \verb|\?|.
|