I am wondering if reorganising a table like

REORGANIZE TABLE "hades"."courses";

leads to exactly the same result as executing following 2 statements (here a recursive constraint to table courses, i. e. relationship in the data model, otherwise of course the related table)

REORGANIZE TABLE "hades"."courses" PRIMARY KEY;
REORGANIZE TABLE "hades"."courses" FOREIGN KEY "course_predecessor_of_fk";

Has the order of executing the above 2 statements any relevance?

Best regards, Robert

asked 09 Jun, 05:53

robert's gravatar image

robert
688414759
accept rate: 0%

It is an excellent question.

I believe the answer is "Yes, REORGANIZE TABLE just-the-table-name does everything... it reorganizes the table and all the indexes."

The Help says this: "If an index or key is not specified, the reorganization process defragments rows in the table by deleting and re-inserting groups of rows."

AFAIK, deleting and inserting all the table rows implicitly recreates all the indexes... how could it do otherwise? :)

However, there may be some subtle differences in the effects of separate REORGANIZE statements for separate indexes.

WHATEVER THE ANSWER, the Help should be clear.

(09 Jun, 07:37) Breck Carter

@Volker: Has this question been answered before? If anyone knows the answer to that, it's you :)

(09 Jun, 07:41) Breck Carter
Replies hidden

LOL, I do trust the search more than my memory, but YMMV:) - According to both sources, I don't think this question has been answered before, and I don't know the answer, either.

(09 Jun, 08:37) Volker Barth
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×29

question asked: 09 Jun, 05:53

question was seen: 73 times

last updated: 09 Jun, 08:37