JanWieck@t-online.de (Jan Wieck) writes:
> Hmmm - thinking about that it doesn't sound bad if we allways
> create a secondary relation at CREATE TABLE time, but NOT the
> index for it. And at VACUUM time we create the index if it
> doesn't exist AND there is external stored data.
Don't much like that --- what if the user doesn't run vacuum for
a good long while? Could be doing a lot of sequential scans over
a pretty large toast file...
If the 16K for an empty btree index really bothers you, let's
attack that head-on. I don't see why a freshly created index
couldn't be zero bytes, and the metadata page gets created on
first store into the index.
> The toaster needs to use sequential scans on the external
> table until the next vacuum run, but index usage allways
> depends on vacuum so that's not a real issue from my PoV.
What makes you say that? Indexes will be used on a never-vacuumed
table with the current planner.
regards, tom lane