Re: [PERFORM] function call vs staright query

2007-03-18 Thread Tom Lane
Vincenzo Romano <[EMAIL PROTECTED]> writes: > How can I delay the query planner decisions until the actual query is to be > done inside the function body? Use plpgsql's EXECUTE. AFAIR there is no way in a SQL-language function. regards, tom lane -

Re: [PERFORM] Performance Tuning and Disk Cache

2007-03-18 Thread Michael Stone
On Sun, Mar 18, 2007 at 06:45:34AM -0600, Barry Moore wrote: Does anyone know how I can repeatedly run the same query in the "worst case scenario" of no postgres data in the disk cache (e.g., clear the page cache or force it to be ignored)? Depends on your OS. On linux you can run: echo 1 >

Re: [PERFORM] Performance Tuning and Disk Cache

2007-03-18 Thread Rangarajan Vasudevan
If you are running on a Linux kernel, try /proc/sys/vm/drop_caches. I believe the appropriate command is "echo 3 > /proc/sys/vm/drop_caches". Since Postgres has its own cache of data, the above followed by a PG restart should do what you are looking for. Ranga > Barry Moore wrote: > >> I have a

Re: [PERFORM] Performance Tuning and Disk Cache

2007-03-18 Thread David Boreham
Barry Moore wrote: I have a very slow query that I'm trying to tune. I think my performance tuning is being complicated by the system's page cache. If a run the query after the system has been busy with other tasks for quite a long time then the query can take up to 8-10 minutes to compl

Re: [PERFORM] Performance Tuning and Disk Cache

2007-03-18 Thread hubert depesz lubaczewski
On 3/18/07, Barry Moore <[EMAIL PROTECTED]> wrote: Does anyone know how I can repeatedly run the same query in the "worst case scenario" of no postgres data in the disk cache (e.g., clear the page cache or force it to be ignored)? try to disconnect from postgresql, reconnect, rerun the query. i

[PERFORM] Performance Tuning and Disk Cache

2007-03-18 Thread Barry Moore
I have a very slow query that I'm trying to tune. I think my performance tuning is being complicated by the system's page cache. If a run the query after the system has been busy with other tasks for quite a long time then the query can take up to 8-10 minutes to complete. If I then rerun

Re: [PERFORM] text equality worse than pattern matching (v8.1.8)

2007-03-18 Thread hubert depesz lubaczewski
On 3/18/07, Vincenzo Romano <[EMAIL PROTECTED]> wrote: And these are the EXPLAINs for the queries: please provide output of "explain analyze" of the queries. otherwise - it is not really useful. depesz ---(end of broadcast)--- TIP 4: Have you se

[PERFORM] text equality worse than pattern matching (v8.1.8)

2007-03-18 Thread Vincenzo Romano
I'm running in some weird (IMHO) bahviour. When I search a table for certain text (equality est on the relelvant field) it takes much more time than doing the same test by adding a trailing '%' and using the LIKE operator. With much more I mean 1000+ times slower. This is the table (sorry for the