Re: [SQL] Problem with query on history table

2006-03-01 Thread Andreas Joseph Krogh
On Wednesday 01 March 2006 23:19, Jim C. Nasby wrote: > Probably the easiest way is to switch to using table partitioning and > switch to using start_timestamp and end_timestamp, so that when you > modify a row you update the old one setting end_timestamp to now() and > insert the new row (all with

Re: [SQL] Problem with query on history table

2006-03-01 Thread Jim C. Nasby
Probably the easiest way is to switch to using table partitioning and switch to using start_timestamp and end_timestamp, so that when you modify a row you update the old one setting end_timestamp to now() and insert the new row (all within one transaction). There are other ways to do it, but they'

Re: [SQL] Problem with query

2003-01-28 Thread Josh Berkus
Ricardo, For future notice, there is another mailing list, PGSQL-PERFORMANCE, devoted to questions like yours. > select * from llamada where fecha='20030127' and tipo=1 and tiempo>0 > and gwdes like '64.7.127.14%' order by hora desc; > > It's very slow, it takes approximately 6 minutes to show m

Re: [SQL] Problem with query

2003-01-28 Thread Tom Lane
=?iso-8859-1?B?UmljYXJkbyBKYXZpZXIgQXJhbmliYXIgTGXzbg==?= <[EMAIL PROTECTED]> writes: > I used PostgreSQL 7.0.3 Please consider upgrading to something more recent. 7.0 predates a lot of work we've done on query optimization ... regards, tom lane ---