When to use inherited tables in PostgreSQL? -


In what situations should you use inherited tables? I tried to use them very briefly and did not see heritage in the OOP world.

I thought it worked like this:

table user which is required for all user levels from all fields by parent moderator Tables are such as , admin , bloggers etc., but fields are not for example users Email field and inherited bloggers still but it can be used for both users and bloggers Finance is not the same time. To wit. As I add email fields to both tables.

The only use I could think was that fields that are commonly used, such as row_is_deleted , created_at , modified_at . Is it the use only for tables inherited?

There are a few key reasons to use the table late in postgres

, We need some tables for the data that are created and filled each month:

Statistics - Statistics_2010_04 (Code of Statistics) - Statistics_2010_05 (Processed Data)

In this sample, we have 2.000,000 rows in each table

Then the legacy is a good start Why does the mode - why is it good to split the data? Execution: When selecting data, we select data between Exchange and X, and postgres only Use tables, where it makes sense. for example. Choose from * where data '2010-04-01' and '2010-04-15' only scales the table statistics -2010_04, all other tables will not be touched - fast!

  • Index size: We do not have any large fat table with a large thick index on the date of the column
  • Maintenance: We vacuum on every month's table without locking all other data Full, reindex, can run cluster
  • For correct usage of table succes as performance boosters, see PostGraseclaw Manual. You need to define the check limit on each table, which tells the database on which your data is divided.

    I use heavily in table inheritance, especially when it stores log data. Hint: If you store data, which will never change (log data), create or turn on CREATE INDEX with index () (fillfactor = 100); This means that no place will be reserved for updates - the index is small on the disk.

    UPDATE: Filler is the default 100, from:

    The percentage of the filler for the table is between 10 and 100. 100 (full packing) default is


    Comments