Re: how to vacuum thru psycopg
Al Niessner <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <1244847499.13002.21.camel@charon> |
psql> analyze verbose <table> ; INFO: "group_name": scanned 1 of 1 pages, containing 1 live rows and 0 dead rows; 1 rows in sample, 1 estimated total rows INFO: "pair_name": scanned 1 of 1 pages, containing 58 live rows and 0 dead rows; 58 rows in sample, 58 estimated total rows INFO: "pair_value": scanned 102 of 102 pages, containing 5864 live rows and 1 dead rows; 3000 rows in sample, 5864 estimated total rows INFO: "metadata": scanned 655 of 655 pages, containing 88974 live rows and 33 dead rows; 3000 rows in sample, 88974 estimated total rows INFO: "picture": scanned 178 of 178 pages, containing 2082 live rows and 1 dead rows; 2082 rows in sample, 2082 estimated total rows So everything seems to meet my expectations except that there are more unique values than I would have guessed initially. However, the more I think about it the more that seems correct too because I think the date and time are in the EXIF. >From the metadata table and picture table, I see there is about 43 elements per photo which is what I expect. The three tables that I select from each transaction are group_name, pair_name, and pair_value. I do not see these growing linear with insertion over 2000 insertions. If it is taking postgresql 30 seconds to scan 6000 elements, then I think there is a bit of an issue with the database. On Fri, 2009-06-12 at 15:23 -0700, Tim Roberts wrote: > Tim Roberts wrote: > > If you're doing it with a Python dictionary, then it will still be > > linear in time, but it will be a much shorter time. > > > > Following up on my own post, it would be quite reasonable to read the > entire key/value table into a dictionary to enable this. If the whole > table is only a few megabytes, that's nothing. That would allow you to > do the uniqueness checks without ever going to the server. > -- Al Niessner I have never found the companion that was so companionable as solitude. - From Walden by Henry David Thoreau The universe is indifferent, and life is brutal; however, it is man's choice of behavior that makes them malevolent rather than benevolent. Some will fall in love with life and drink it from a fountain That is pouring like an avalanche coming down the mountain. - From the song Pepper by the Butthole Surfers