# Questions around optimize and table segments

**URL:** <https://community.cratedb.com/t/questions-around-optimize-and-table-segments/1145>\
**Category:** CrateDB\
**Created:** [June 7, 2022, 11:50am UTC](https://community.cratedb.com/t/questions-around-optimize-and-table-segments/1145 "2022-06-07T11:50:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinayak.shukre](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vinayak.shukre](https://community.cratedb.com/u/vinayak.shukre)\
**Post date:** [June 7, 2022, 11:50am UTC](https://community.cratedb.com/t/questions-around-optimize-and-table-segments/1145/1 "2022-06-07T11:50:23Z")

</div>

Hi Crate team,  
I read about [optimize](https://crate.io/docs/crate/reference/en/4.8/admin/optimization.html) command to align all table segments on the disk so that read performance can be improved and few questions came up.

1. Is there any way I can see how the segments are spread for my table or for a table partition?
2. I have done only insert operation using JDBC in a table partition and did not do any delete or update operations. Is there is chance of spread out segments in this case? Will firing optimize command further improve read performance?
3. Documentation says that CrateDB does the optimization in the background. Is there any way I can check if it is complete or pending?

---

<div class="post-metadata">

**Author:** ![hammerhead](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hammerhead/32/270_2.png) [@hammerhead](https://community.cratedb.com/u/hammerhead)\
**Post date:** [June 8, 2022, 9:08am UTC](https://community.cratedb.com/t/questions-around-optimize-and-table-segments/1145/2 "2022-06-08T09:08:08Z")

</div>

Hi @vinayak.shukre,

1. Yes, the system table [sys.segments](https://crate.io/docs/crate/reference/en/4.8/admin/system-information.html#segments) exposes information about the segments. This includes the table that the segment belongs to, the segment size/number of documents, and more.

2. Also when running only INSERT statements, optimizations can happen. Segments are written on two conditions, as per the [Lucene documentation](https://lucene.apache.org/core/9_2_0/core/org/apache/lucene/index/IndexWriter.html):

3. I don’t think there is currently any information exposed on ongoing/past optimizations. Optimizations typically don’t require much attention as they are more of a housekeeping task to keep overhead caused by segments low.

Is there a particular practical reason why you want to take a closer look at segments, or is it just out of curiosity?

---

<div class="post-metadata">

**Author:** ![vinayak.shukre](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vinayak.shukre](https://community.cratedb.com/u/vinayak.shukre)\
**Post date:** [June 16, 2022, 1:38pm UTC](https://community.cratedb.com/t/questions-around-optimize-and-table-segments/1145/3 "2022-06-16T13:38:13Z")

</div>

Hi @hammerhead ,  
As it said it improves the read/query performance if there are less number of big size segments, I was exploring it.
