4 ms·
You can restore data to a table from a dump using pg_restore without recreating indexes. If you have a couple extremely large tables, you should consider partit
by dougabug 16y ago
You can restore data to a table from a dump using pg_restore without recreating indexes. If you have a couple extremely large tables, you should consider partitioning them. Partitions are true tables in Postgres, and you should be able to use parallel restore on them.
Bruce Momjian told me on Monday that Robert Haas was leading the index only scan effort, and that this (important) feature should appear in the 9.2 time frame.
Most hints are a bad idea, they represent leaks in the relational abstraction. Further, the DBA's knowledge of the performance characteristics of various tasks is transient, and often quickly mooted by changes in technology, data scale/statistics, or even simple hardware/software reconfiguration. FIRST_ROWS is a reasonable hint, since it speaks to the logical intent of the query, and says something about how much of the data it intends to use and how it prioritizes the results. The planner can then work towards the stated optimization goal.
- someotheridiot 16y agoI think you forgot to finish your sentence. You were about to say how to do it?
- dougabug 16y agoPg_restore is pretty flexible. You can have it generate a list of the objects in the dump, and then edit that file to create/restore only the objects of interest. You can omit/change permissions, schema objects, restore order, etc. You can also specify data only restore as a command line option. If you don't want the index, just remove it from the table definition and do a data only restore on that table.
- wulczer 16y agoIf you find yourself needing an index only scan, you can try to use workarounds like http://wiki.postgresql.org/wiki/Loose_indexscan http://wiki.postgresql.org/wiki/Loose_indexscan