Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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" FOREIGN KEY "course_predecessor_of_fk";

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

Best regards, Robert

asked 09 Jun '20, 05:53

robert's gravatar image

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 '20, 07:37) Breck Carter

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

(09 Jun '20, 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 '20, 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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 09 Jun '20, 05:53

question was seen: 600 times

last updated: 09 Jun '20, 08:37