Re: [PERFORM] How to unique-ify HUGE table?

2008-12-23 Thread George Pavlov
You don't say what PG version you are on, but just for kicks you may try using GROUP BY instead of DISTINCT. Yes, the two should perform the same, but with 8.1 (or maybe 8.0) I had seen situations where GROUP BY was faster (admittedly this happened with more complex queries). So, try this:

Re: [PERFORM] performance drop on 8.2.4, reverting to 8.1.4

2007-05-18 Thread George Pavlov
This seems to be the source of the misestimation. You might want to try using n WHERE n.nodein NOT IN (SELECT nodeid FROM templates) instead of n LEFT JOIN templates USING (nodeid) WHERE templates.nodeid IS NULL and see if it helps. it helped, the new version of the query takes 2303

Re: [PERFORM] Not Picking Index

2007-02-16 Thread George Pavlov
Note the DROP INDEX will acquire exclusive lock on the table, so this might not be the greatest thing to do in a production environment. In PG 8.2 and up there is a sneakier way to do it that won't acquire any more lock than the statement-under-test does: begin; update pg_index

Re: [PERFORM] query slows down drastically with increased number of fields

2006-10-26 Thread George Pavlov
i have wondered myself. i wouldn't do it through pgAdmin (not sure what the best test it, but i thought psql from the same machine might be better--see below). anyway, the funny thing is that if you concatenate them the time drops: ~% time psql -dXXX -hYYY -UZZZ -cselect consumer_id from consumer

Re: [PERFORM] Related to Inserting into the database from XML file

2006-08-27 Thread George Pavlov
On Fri, 2006-08-25 at 21:23 +0530, soni de wrote: Hello, I want to ask, Is there any way to insert records from XML file to the postgres database? Try the contrib/xml2 module. Alas, that module will not help you much with the insertion of records. It is more about querying XML that

Re: [PERFORM] stats reset during pg_restore?

2006-08-27 Thread George Pavlov
These stats are not stored in tables, only in memory and saved to a special file on disk to be able to preserve it across server stop/start. But pg_dump does not make the slightest attempt to save it. Also, you can't save it yourself -- while you could save the values it returns on

Re: [PERFORM] [8.1.4] Help optimizing query

2006-08-27 Thread George Pavlov
Without having looked at this in detail my first suggestion would be to do away with those date_part indices. I have found that indexes with few distinct values usually hurt more then help and the PG optimizer is not always smart enough to ignore them and the BitmapAnd and scan for dates seem like

[PERFORM] stats reset during pg_restore?

2006-08-26 Thread George Pavlov
This did not have any takers in pgsql-general. Maybe performance-oriented folks can shed light? The basic question is if there is a way to preserve stats during pg_restore? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Pavlov Sent: Monday

[PERFORM] PITR performance overhead?

2006-08-01 Thread George Pavlov
I am looking for some general guidelines on what is the performance overhead of enabling point-in-time recovery (archive_command config) on an 8.1 database. Obviously it will depend on a multitude of factors, but some broad-brush statements and/or anecdotal evidence will suffice. Should one worry