Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,798

    Unanswered: Child table is huge

    Hello I have a child table that is huge and I was wondering what the best course of action would be so the users are only getting some of the data and not all of it. seems like the data is running slow because the child tables are so big. Not sure if this is making any sense

  2. #2
    Join Date
    Oct 2007
    Posts
    162
    Provided Answers: 9
    The SQL you write for the users within your application will determine how much of the child data is returned. As far as being slow, have you reviewed the access path to determine if it is making best use of the existing indexes or to see if another index may be more helpful?

  3. #3
    Join Date
    Jan 2013
    Posts
    359
    Provided Answers: 1
    Quote Originally Posted by desireemm View Post
    Hello I have a child table that is huge and I was wondering what the best course of action would be so the users are only getting some of the data and not all of it. seems like the data is running slow because the child tables are so big. Not sure if this is making any sense
    First of all, we need to get the terminology right. The terms "child" and "parent" are not part of RDBMS; they are part of the old network databases. In SQL. We have "referenced" and "referencing tables", which are very different, concepts. If you use the references clause in your DDL (which you did not post!), SQL engines will try to do the work for you. For example, say were taking orders in the typical commercial database, and the details of the orders include the global trade item number to identify the particulars of each order.

    CREATE TABLE Orders
    (order_nbr CHAR(10) NOT NULL PRIMARY KEY,
    ..);

    CREATE TABLE Orders_Details
    (order_nbr CHAR(10) NOT NULL
    REFERENCES Orders(order_nbr)
    ON DELETE CASCADE,
    item_gtin CHAR(15) NOT NULL,
    PRIMARY KEY (order_nbr,item_gtin),
    ..);

    Notice how the DRI actions will take care of automatically deleting the weak entities when the strong entity that created them still exist.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •