MulaiMulai sekarang secara gratis

Exploring pg_tables

In order to make a query plan, the query planner needs basic information like table names, column names, and the number of rows of each table or view. Without this information, the planner would not know how many rows to search to find a specific columns used in filter conditions. It would not know if it can use an index search.

This type of metadata is stored in the pg_tables schema. Specifically, the planner uses pg_class and pg_stats. Take a look to see what kind of information these objects contain.

Latihan ini adalah bagian dari kursus

Improving Query Performance in PostgreSQL

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

SELECT ___ -- Index indicator column
FROM pg_class
WHERE relname = 'daily_aqi';
Edit dan Jalankan Kode