Views, indices and pg_dump

From: Zak McGregor <zak(at)mighty(dot)co(dot)za>
To: pgsql-general(at)postgresql(dot)org
Subject: Views, indices and pg_dump
Date: 2001-03-27 03:20:50
Message-ID: 200103270320.FAA03267@zak.home.dom
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all

Thanks to everyone for this great forum, and for Postgres!

I have a couple of questions:

I have a smallish table which I join on another (smaller) table. I have
created a view for this purpose, thinking it would save on overhead.
The view also incorporates some calculated fields. However, when I do an
EXPLAIN SELECT * FROM my_view it shows sequential scans on both tables and
no use of any indices (I've created them on the view and the two other
tables). It seems the view does the join on the fly. If so, will using a
view speed up queries? Also, how do I make it use the indices for queries?

Another, slightly unrelated question: Why does pg_dump dump the view as a
normal table?

Thanks so much for your help

Cheers

Zak

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Davies 2001-03-27 03:33:53 records zapped to null
Previous Message Mark Knox 2001-03-27 03:13:33 Re: Re: Call for platforms