On Sep 17, 2013, at 7:43 AM, Kevin Grittner <kgrittn@xxxxxxxxx> wrote: Natalie Wenz <nataliewenz@xxxxxxxxxxx> wrote:I have a large database from our test environment that got into trouble with Sorry; my description of what is going on was a little unclear. We didn't upgrade the existing database. We moved it to different hardware, and just created a brand new database to accept the data that had been backing up in sqlite files while our original database was offline. I'm still dealing with the wraparound on the original, just on a different machine. Now: The brand new database on 9.3 is running great. The original, running on 9.1, is the one I'd like to extract data from (it is currently vacuuming). After I get the data out of the original, whether I wait for the vacuum to finish or not, I'll have to manually import all of the old data into the new database, but it was decided that that was a reasonable tradeoff if it meant we could get our current data out of the buffer files and get our regular tools and reports back online today. We want all of the older data eventually, but it's not critical for our day-to-day operation. Is it possible to somehow just dump the data using pg_dump or pg_dumpall? I I'll give that a try. It sounds like I technically have enough transactions left to copy the data out, so that is good. Hopefully the database will let me use that utility. Otherwise I'll just do a copy from the backend. Would there be any risks if I were to do that? Maybe none of this version | PostgreSQL 9.1.9 on x86_64-unknown-freebsd9.1, compiled by gcc (GCC) 4.2.1 20070831 patched [FreeBSD], 64-bit autovacuum | on autovacuum_analyze_scale_factor | 0.1 autovacuum_freeze_max_age | 800000000 autovacuum_max_workers | 3 autovacuum_vacuum_cost_delay | 0 autovacuum_vacuum_scale_factor | 0.1 checkpoint_segments | 128 effective_cache_size | 12GB listen_addresses | * log_autovacuum_min_duration | 10s log_destination | stderr log_filename | logfile-%A.log log_line_prefix | %t:%u:%r:[%p]: log_rotation_age | 1d log_rotation_size | 1GB log_truncate_on_rotation | on logging_collector | on maintenance_work_mem | 10GB max_connections | 500 max_stack_depth | 2MB random_page_cost | 1 seq_page_cost | 1 shared_buffers | 128MB synchronous_commit | off temp_buffers | 128MB TimeZone | US/Central vacuum_cost_limit | 500 wal_buffers | 32MB work_mem | 256MB This is the tuning of the original database, anything changed from the default settings. The machine it was running on had 48GB of memory. The database was 36TB, with 2 tables taking up the bulk of that (about 14TB each), and about 10 other tables and a few large indexes making up the rest. Our typical usage pattern is mostly inserts, with a some hourly summaries (which take maybe 5 minutes), some daily summaries (which take about 20-40 minutes), and a couple of end of month queries that take several hours. We have the same setup and tuning in production, which is about the same size, with an additional end of month query that runs off one of the 14TB tables, which can take 4-7 days. Any ideas or suggestions? Normally the autovacuum seem to keep up sufficiently. We got into trouble with a bad combination of not-typical long-running queries, a disk failure and subsequent zpool repair, and the only person who checks the log files regularly (me) was out of the office. This has been so painful and slow to recover from, I don't think we'll ever get into this mess again. (At least not quite like this. I seem to have a knack for finding *new* ways to break things.) I will also take this opportunity to mention again that if anyone is considering a making a patch for 64-bit xids, you would make at least one small group of people very, very happy. :) Side question: some of the longer queries that were running when the database yakked were deletes of old data that had been manually migrated to a new table with a more appropriate format. We were running out of disk space, so we were trying to clear up some space by removing data we now had in two places. Does a delete of previously-frozen rows unfreeze them, or anything like that? Because in a series of maybe a dozen queries or so, we deleted billions of rows. Does that generate a significant amount of extra work for the autovacuumer? I'm sorry that I don't have a better suggestion for resolving the Thanks for your feedback! It's kind of a dismal situation, but I'm anxious to learn whatever I can from it. -- |