BaşlayınÜcretsiz Başlayın

Using the information schema

The most basic optimization method with column-oriented storage databases is to reduce the number of columns each query returns.

When working with new tables, it is common to select the first 5 or 10 rows. However, a basic select on a wide table may be resource intensive. The information schema provides some column metadata and is a good starting place to learn about your data.

While it does not show as available, views in the information_schema are always available to query. Feel free to explore the columns view in the console to explore what information is available before completing the exercise.

Bu egzersiz

Improving Query Performance in PostgreSQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use the columns view from the information_schema.
  • Select the column_name, data_type, and is_nullable columns.
  • Use table_name to limit results to the daily_aqi table.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Examine metadata about daily_aqi
SELECT ___ , ___ , ___
FROM ___
WHERE table_catalog = 'olympics_aqi'
AND ___ = ___ -- Limit to a specific table
;
Kodu Düzenle ve Çalıştır