Re: [PERFORM] CLUSTER and a problem

2009-09-15 Thread Andrzej Zawadzki
Andrzej Zawadzki wrote: > Tom Lane wrote: > >> Andrzej Zawadzki writes: >> >> >>> # EXPLAIN ANALYZE SElect telekredytid from kredytyag >>> WHERE TRUE >>> AND kredytyag.id = 3064776 >>> AND NOT EXISTS >>> (SELECT 1 FROM >>> ( SELECT * FROM kredyty kr >>> where telekredytid = 328650 >>> O

[PERFORM] statement stats extra load?

2009-09-15 Thread Alan McKay
Is there a rule of thumb for the extra load that will be put on a system when statement stats are turned on? And if so, where does that extra load go?Disk? CPU? RAM? -- “Don't eat anything you've ever seen advertised on TV” - Michael Pollan, author of "In Defense of Food" -- Sen

Re: [PERFORM] View vs Stored Proc Performance

2009-09-15 Thread Ivan Voras
2009/9/15 Tom Lane : > Ivan Voras writes: >> Are functions in language 'sql' handled differently than those of >> language 'plpgsql'? > > Yes. > >> I think they're not so in any case a function will behave as a black box >> with regards to the planner and optimizer (and views are always >> 'transp

Re: [PERFORM] disable heavily updated (but small) table auto-vecuuming

2009-09-15 Thread Robert Haas
2009/9/15 Ludwik Dylag : > Hello > I have a database where I daily create a table. > Every day it is being inserted with ~3mln rows and each of them is being > updated two times.The process lasts ~24 hours so the db load is the same at > all the time. total size of the table is ~3GB. > My current v

Re: [PERFORM] View vs Stored Proc Performance

2009-09-15 Thread Tom Lane
Ivan Voras writes: > Are functions in language 'sql' handled differently than those of > language 'plpgsql'? Yes. > I think they're not so in any case a function will behave as a black box > with regards to the planner and optimizer (and views are always > 'transparent'). No.

Re: [PERFORM] View vs Stored Proc Performance

2009-09-15 Thread Ivan Voras
Merlin Moncure wrote: On Sat, Sep 12, 2009 at 7:51 AM, Dimitri Fontaine wrote: Merlin Moncure writes: like joining the result to another table...the planner can see 'through' the view, etc. in a function, the result is fetched first and materialized without looking at the rest of the query.

Re: [PERFORM] How to post Performance Questions

2009-09-15 Thread Kevin Grittner
Michael Glaesemann wrote: > On Sep 14, 2009, at 16:55 , Josh Berkus wrote: >> Please read the following two documents before posting your >> performance query here: >> >> http://wiki.postgresql.org/wiki/Guide_to_reporting_problems >> http://wiki.postgresql.org/wiki/SlowQueryQuestions >> >> Thi

[PERFORM] Problem with partitionning and orderby query plans

2009-09-15 Thread Gaël Le Mignot
Hello, In the same context that my previous thread on this mailing list (the database holding 500k articles of a french daily newspaper), we now need to handle the users' comments on the articles (1 million for now, quickly growing). In our context, we'll have three kind of queries : - quer

Re: [PERFORM] CLUSTER and a problem

2009-09-15 Thread Andrzej Zawadzki
Andrzej Zawadzki wrote: > Tom Lane wrote: > >> Andrzej Zawadzki writes: >> >> >>> # EXPLAIN ANALYZE SElect telekredytid from kredytyag >>> WHERE TRUE >>> AND kredytyag.id = 3064776 >>> AND NOT EXISTS >>> (SELECT 1 FROM >>> ( SELECT * FROM kredyty kr >>> where telekredytid = 328650 >>> O

Re: [PERFORM] possible wrong query plan on pg 8.3.5,

2009-09-15 Thread zz_11
Цитат от Віталій Тимчишин : May be you have very bad disk access times (e.g. slow random access)? In this case everything should be OK while data in cache and awful, when not. Could you check disk IO speed && IO wait while doing slow & fast query. No, I think all is ok with disks. On my test

[PERFORM] disable heavily updated (but small) table auto-vecuuming

2009-09-15 Thread Ludwik Dylag
Hello I have a database where I daily create a table. Every day it is being inserted with ~3mln rows and each of them is being updated two times.The process lasts ~24 hours so the db load is the same at all the time. total size of the table is ~3GB. My current vacuum settings are: autovacuum = on

Re: [PERFORM] CLUSTER and a problem

2009-09-15 Thread Andrzej Zawadzki
Tom Lane wrote: > Andrzej Zawadzki writes: > >> # EXPLAIN ANALYZE SElect telekredytid from kredytyag >> WHERE TRUE >> AND kredytyag.id = 3064776 >> AND NOT EXISTS >> (SELECT 1 FROM >> ( SELECT * FROM kredyty kr >> where telekredytid = 328650 >> ORDER BY kr.datazaw DESC LIMIT 1 ) >> kred where k