Re: [PERFORM] count * performance issue

2008-03-07 Thread paul rivers
Mark Mielke wrote: Josh Berkus wrote: Count() on Oracle and MySQL is almost instantaneous, even for very large tables. So why can't Postgres do what they do? AFAIK the above claim is false for Oracle. They have the same transactional issues we do. Nope. Oracle's MVCC is implemen

Re: [PERFORM] count * performance issue

2008-03-07 Thread Tom Lane
Greg Smith <[EMAIL PROTECTED]> writes: > I know when I'm playing with pgbench the primary key index on the big > accounts table is 1/7 the size of the table, and when using that table > heavily shared_buffers ends up being mostly filled with that index. The > usage counts are so high on the inde

Re: [PERFORM] count * performance issue

2008-03-07 Thread Mark Mielke
Josh Berkus wrote: Count() on Oracle and MySQL is almost instantaneous, even for very large tables. So why can't Postgres do what they do? AFAIK the above claim is false for Oracle. They have the same transactional issues we do. Nope. Oracle's MVCC is implemented through rollback

Re: [PERFORM] count * performance issue

2008-03-07 Thread Greg Smith
On Fri, 7 Mar 2008, Tom Lane wrote: Well, scanning an index to get a count might be significantly faster than scanning the main table, but it's hardly "instantaneous". It's still going to take time proportional to the table size. If this is something that's happening regularly, you'd have to

[PERFORM] Re: Confirmação de envio / Sending confirmation (captchaid:13266b402f09)

2008-03-07 Thread petchimuthu lingam
VQQ7HE18 On Sat, Mar 8, 2008 at 9:50 AM, <[EMAIL PROTECTED]> wrote: >A mensagem de email enviada para [EMAIL PROTECTED] confirmação para ser > entregue. Por favor, responda este e-mail > informando os caracteres que você vê na imagem abaixo. > > The email message sent to pgsql-performance@po

[PERFORM] Confirmação de envio / Sending confirmation (captchaid:13266b402bd3)

2008-03-07 Thread petchimuthu lingam
VE4TQQBN -- With Best Regards, Petchimuthulingam S

[PERFORM] join query performance

2008-03-07 Thread petchimuthu lingam
In a select query i have used the join conditions, will it affect query performance. Explicitly I didn't used the join command, Will it make any difference. My Query is: SELECT test_log.test_id, test_log.test_id, test_log.test_id, user_details.first_name, group_details.group_name, site_details.s

Re: [PERFORM] count * performance issue

2008-03-07 Thread Tom Lane
Josh Berkus <[EMAIL PROTECTED]> writes: > Tom, >>> Count() on Oracle and MySQL is almost instantaneous, even for very >>> large tables. So why can't Postgres do what they do? >> >> AFAIK the above claim is false for Oracle. They have the same >> transactional issues we do. > Nope. Oracle's MVCC

Re: [PERFORM] count * performance issue

2008-03-07 Thread Josh Berkus
Tom, > > Count() on Oracle and MySQL is almost instantaneous, even for very > > large tables. So why can't Postgres do what they do? > > AFAIK the above claim is false for Oracle. They have the same > transactional issues we do. Nope. Oracle's MVCC is implemented through rollback segments, rath

Re: [PERFORM] Why the difference in plans ?

2008-03-07 Thread Josh Berkus
Dave, > "user_profile_pkey" PRIMARY KEY, btree (uid) CLUSTER > "user_profile_name_idx" UNIQUE, btree (name varchar_pattern_ops) > "user_profile_name_key" UNIQUE, btree (name) > "user_profile_uploadcode_key" UNIQUE, btree (uploadcode) > "user_profile_active_idx" btree (isact

Re: [PERFORM] count * performance issue

2008-03-07 Thread Mark Kirkwood
Craig James wrote: Tom Lane wrote: Craig James <[EMAIL PROTECTED]> writes: Count() on Oracle and MySQL is almost instantaneous, even for very large tables. So why can't Postgres do what they do? AFAIK the above claim is false for Oracle. They have the same transactional issues we do. My ex

Re: [PERFORM] Effects of cascading references in foreign keys

2008-03-07 Thread Bruce Momjian
Added to TODO: * Improve referential integrity checks http://archives.postgresql.org/pgsql-performance/2005-10/msg00458.php --- Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > On Sat, Oct 29, 2005 at 09:4

Re: [PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
Thanks to all for time and valuable help, Pavel Rotek 2008/3/7, Bill Moran <[EMAIL PROTECTED]>: > > In response to "Pavel Rotek" <[EMAIL PROTECTED]>: > > > > 2008/3/7, Tom Lane <[EMAIL PROTECTED]>: > > > [snip] > > > > > If you have to do it that way, you'll need very frequent vacuums on > this >

Re: [PERFORM] Toast space grows

2008-03-07 Thread Bill Moran
In response to "Pavel Rotek" <[EMAIL PROTECTED]>: > 2008/3/7, Tom Lane <[EMAIL PROTECTED]>: [snip] > > If you have to do it that way, you'll need very frequent vacuums on this > > table (not vacuum full, as noted already) to keep the toast space from > > bloating too much. And make sure you've

Re: [PERFORM] Toast space grows

2008-03-07 Thread Tom Lane
"Pavel Rotek" <[EMAIL PROTECTED]> writes: > 2008/3/7, Tom Lane <[EMAIL PROTECTED]>: >> You mean that you build up the 5MB log entry by adding a few lines at a >> time? That's going to consume horrid amounts of toast space, because >> each time you add a few lines, an entire new toasted field value

Re: [PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
2008/3/7, Matthew <[EMAIL PROTECTED]>: > > On Fri, 7 Mar 2008, Pavel Rotek wrote: > > well, this will be the main problem... But... do uncomitted trasactions > > affect toast space? > > > I think the demonstrated answer to this is yes. > > > > (begin tx, load previous log, do business action, appen

Re: [PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
2008/3/7, Matthew <[EMAIL PROTECTED]>: > > > "Pavel Rotek" <[EMAIL PROTECTED]> writes: > >> No i do not mean long running transactions... Update of log entry > (update of > >> row in dataaction) is performed in series of short transactions, but > during > >> short transaction there is a lot of chan

Re: [PERFORM] Toast space grows

2008-03-07 Thread Matthew
On Fri, 7 Mar 2008, Pavel Rotek wrote: well, this will be the main problem... But... do uncomitted trasactions affect toast space? I think the demonstrated answer to this is yes. (begin tx, load previous log, do business action, append new log, flush, do business action, append new log, flush

Re: [PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
2008/3/7, Tom Lane <[EMAIL PROTECTED]>: > > "Pavel Rotek" <[EMAIL PROTECTED]> writes: > > No i do not mean long running transactions... Update of log entry > (update of > > row in dataaction) is performed in series of short transactions, but > during > > short transaction there is a lot of change l

Re: [PERFORM] Toast space grows

2008-03-07 Thread Matthew
"Pavel Rotek" <[EMAIL PROTECTED]> writes: No i do not mean long running transactions... Update of log entry (update of row in dataaction) is performed in series of short transactions, but during short transaction there is a lot of change log value, flush, change log value ,flush . change log

Re: [PERFORM] Toast space grows

2008-03-07 Thread Tom Lane
"Pavel Rotek" <[EMAIL PROTECTED]> writes: > No i do not mean long running transactions... Update of log entry (update of > row in dataaction) is performed in series of short transactions, but during > short transaction there is a lot of change log value, flush, change log > value ,flush . chang

Re: [PERFORM] Toast space grows

2008-03-07 Thread Alvaro Herrera
Pavel Rotek escribió: > 2008/3/7, Bill Moran <[EMAIL PROTECTED]>: > > Don't do vacuum full on this table. Do frequent vacuums. The table will > > bloat some, but not 10x the required size, once you find a reasonable > > frequency for vacuums. You might find it practical to manually vacuum > > t

Re: [PERFORM] postgresql Explain command output

2008-03-07 Thread RaviRam Kolipaka
How do we know in the output of expain command table or constraint names so that while parsing each line of the output we can able to recognise them and build the pictorial representation. for example if you consider the following output EXPLAIN select * from table1,table2 where

Re: [PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
2008/3/7, Bill Moran <[EMAIL PROTECTED]>: > > In response to "Pavel Rotek" <[EMAIL PROTECTED]>: > > > > > There are inserts and few updates (but what do you mean with update?? > > > He means adding or changing data in the table. I understand, but i don't have deep understanding of mechanism, that

Re: [PERFORM] Toast space grows

2008-03-07 Thread Bill Moran
In response to "Pavel Rotek" <[EMAIL PROTECTED]>: > > There are inserts and few updates (but what do you mean with update?? He means adding or changing data in the table. > committed update??, because there are many updates of the log attribute in > trasaction, we do periodical flush during tran

Re: [PERFORM] Why the difference in plans ?

2008-03-07 Thread Dave Cramer
On 6-Mar-08, at 9:30 PM, Stephen Denne wrote: The strange thing of course is that the data is exactly the same for both runs, the tables have not been changed between runs, and I did them right after another. Even more strange is that the seq scan is faster than the index scan. It is not stra

Re: [PERFORM] Why the difference in plans ?

2008-03-07 Thread Dave Cramer
Josh, On 6-Mar-08, at 12:26 PM, Josh Berkus wrote: Dave, Below I have two almost identical queries. Strangely enough the one that uses the index is slower ??? My first guess would be that records are highly correlated by DOB and not at all by name. However, it would help if you supplie

Re: [PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
we just restored it to free 70G :-( There are inserts and few updates (but what do you mean with update?? committed update??, because there are many updates of the log attribute in trasaction, we do periodical flush during transaction), sum takes approximately 1,2G, and i mean vacuum full (but the

Re: [PERFORM] Toast space grows

2008-03-07 Thread Richard Huxton
Pavel Rotek wrote: Hello, i have problem with following table... create table dataaction ( id INT4 not null, log text, primary key (id) ); It is the table for storing results of long running jobs. The log attribute takes approximately 5MB for one row (there is about 300 rows). My prob

Re: [PERFORM] Improve Full text rank in a query

2008-03-07 Thread Oleg Bartunov
On Fri, 7 Mar 2008, b wragg wrote: Hi all, I'm running the following query to match a supplied text string to an actual place name which is recorded in a table with extra info like coordinates, etc. SELECT ts_rank_cd(textsearchable_index_col , query, 32 /* rank/(rank+1) */) AS rank,* FROM gaze

[PERFORM] Toast space grows

2008-03-07 Thread Pavel Rotek
Hello, i have problem with following table... create table dataaction ( id INT4 not null, log text, primary key (id) ); It is the table for storing results of long running jobs. The log attribute takes approximately 5MB for one row (there is about 300 rows). My problem is, that table da