Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:26:50+00:00 2026-05-28T06:26:50+00:00

I have a log table that is inherited by several tables: CREATE TABLE log

  • 0

I have a log table that is inherited by several tables:

CREATE TABLE log (
    IdGlobal uuid NOT NULL DEFAULT uuid_generate_v1(),
    Version integer NOT NULL DEFAULT 0,
    ChangeDate TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    IsDeleted bool DEFAULT false
);

CREATE TABLE Customer (
    Id SERIAL PRIMARY KEY,
    Code text NOT NULL UNIQUE,
    Name text NOT NULL,
) INHERITS (log);

However, I wonder if have it will make a impact for performance. The DB is for a SASS app in development (early stage) and will have 1 schema=1 company.

I understand that the main advantage in postgres is about partitioning, but my use case is more related to typical OOP.

The log table increase size will hurt me in the long run? Where I put the indexes? In the parent or in the child’s? (I will make searches by IdGlobal & version)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:26:50+00:00Added an answer on May 28, 2026 at 6:26 am

    The log table size won’t affect the queries against Customer table, it’s actually the other way: by default SELECTs, UPDATEs and DELETEs from the log table will run against the Customer table as well, unless you specify the ONLY clause, i.e.
    SELECT * FROM ONLY log;

    Indexes and constraints (unique, primary and foreign key) apply to a single table only, not to the whole inheritance hierarchy, so, unfortunately, you need to create them separately for the parent and for the child tables. This also means that you can’t have a unique index that covers all the tables in the hierarchy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that contains log entries for a program I'm writing. I'm
I have a table that functions as an event log and stores the users
I have the following table EVENT_LOG : EVENT_ID: pk, int, not null TYPEID: fk,
I'm working in Sql Server 2005. I have an event log table that tracks
We have a log table that has a message column that sometimes has an
I have a log table that gets processed every night. Processing will be done
I have tow tables concept_access and concept_access_log. I want to create a trigger that
Consider the following SQL: CREATE TABLE USER1 ( pkUSER1_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
I have a log that is really huge. (millions of rows) LogTable ------- ID
I have an Oracle table which contains event log messages for an application. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.