Re: [GENERAL] external query VS user function

2008-09-11 Thread Merlin Moncure
On Thu, Sep 11, 2008 at 5:38 AM, Joao Ferreira gmail <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm trying to optimize the execution of a query which deletes a big > amount of records based on time > > I need to remove from 100.000 to 1.000.000 records from my table once a > day, and I'dd like to

Re: [GENERAL] external query VS user function

2008-09-11 Thread Peter Eisentraut
Joao Ferreira gmail wrote: I need to remove from 100.000 to 1.000.000 records from my table once a day, and I'dd like to make that removal as fast as possible. This is the idea: DELETE FROM tt WHERE time < $1; Would it be considerably faster if I declare that query inside a user function, let'

Re: [GENERAL] external query VS user function

2008-09-11 Thread Pavel Stehule
Hello 2008/9/11 Joao Ferreira gmail <[EMAIL PROTECTED]>: > Hello all, > > I'm trying to optimize the execution of a query which deletes a big > amount of records based on time > > I need to remove from 100.000 to 1.000.000 records from my table once a > day, and I'dd like to make that removal as f