Re: [PERFORM] delete/recreate indexes

2011-10-25 Thread alan
Thanks Jeff, On Oct 20, 4:51 am, pg...@j-davis.com (Jeff Davis) wrote: > Also, to take a step back, why do you try to keep the timestamps > changing like that? Why not store the information you need in the record > (e.g. insert time as well as the datum) and then compute the result you > need usin

Re: [PERFORM] delete/recreate indexes

2011-10-20 Thread Bort, Paul
> An unrestricted update will end up rewriting the whole table. > It's advisable to run VACUUM afterward, so that the wasted > space can be reclaimed. What version are you on? Do you have > autovacuum enabled? > > Also, to take a step back, why do you try to keep the > timestamps changing like

Re: [PERFORM] delete/recreate indexes

2011-10-19 Thread Jeff Davis
On Wed, 2011-10-19 at 08:03 -0700, alan wrote: > So I thought I’d just run this once (via cron) every morning. > BEGIN; > DROP INDEX data_unique; > UPDATE data SET datum = (data.datum + interval '24 hours'); > CREATE UNIQUE INDEX data_unique ON public.data USING BTREE >

[PERFORM] delete/recreate indexes

2011-10-19 Thread alan
Hi I'm a postgres novice so I have this fairly simple table - device integer not null, group integer not null, datum timestamp without time zone not null, val1 numeric(7,4) not null default 0.000, val2 numeric(7,4) not null default 0.000 -