Hello, all In my DB there are multiple log tables, which store app info connection property. After certain time passes, this value is no longer used and the field can be annulled in some records. Does DB space usage decrease when long nvarchar is set to null?

Thank you Arcady

asked 14 Jan, 08:56

Arcady%20Abramov's gravatar image

Arcady Abramov
862614
accept rate: 0%


Not immediately, because SQL Anywhere never shrinks the database files by itself, as documented here. You will need to do a reload to shrink the database files.

However, deleting rows or setting fields to NULL will mark their previous place as "free" so further data can be placed there, that way reducing the need for further file growth.

Please also have a look at that question, which also lists some diagnostic tools.

permanent link

answered 14 Jan, 09:32

Volker%20Barth's gravatar image

Volker Barth
34.7k337491732
accept rate: 33%

edited 14 Jan, 09:33

And how long would it usually take before the freed space is reflected in sa_table_page_usage() procedure? This is what we need, not actual shrink of the DB file.

(14 Jan, 09:35) Arcady Abramov
Replies hidden

Can't say that because I'm not sure whether sa_table_page_usage() will show when pages are only "partially freed" because there is still data on them. You may also look at the sa_table_fragmentation system procedure.

Here's another FAQ why it may take some time until the process of free'ing deleted data is really observable.

(14 Jan, 10:04) Volker Barth
Your answer
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:

×10

question asked: 14 Jan, 08:56

question was seen: 199 times

last updated: 14 Jan, 10:04