# Performance difference between \_source and fields with store

**URL:** <https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324>\
**Category:** Elasticsearch\
**Created:** [May 2, 2011, 12:33pm UTC](https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324 "2011-05-02T12:33:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [May 2, 2011, 12:33pm UTC](https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324/1 "2011-05-02T12:33:25Z")

</div>

Hi,  
I use ES with version 0.16.0. I tested performance using two mapping  
configuration with a document having 50 string properties.

1. \_source property is disabled, \_all property is disabled and specified  
store parameter of fields as yes.
2. \_source property is enabled, \_all property is disabled and store  
parameter of fields as no

I don't see any significant performance difference between these two in both  
bulk indexing speed and search speed (I tested search by both specifying two  
fields and whole field set). Is this an expected result?

ES cluster and testing java application is on the same PC.  
I tested by inserting 100000 docs divided to 10 bulk operations. And  
performed search 1000 times after inserting docs.

--  
Mustafa Sener  
[www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 3, 2011, 4:13pm UTC](https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324/2 "2011-05-03T16:13:32Z")

</div>

The overhead is pretty simple to understand (1 \_source vs. 50 stored fields), though perf wise, it depends when you will really see it (depends on the concurrency of indexing, how much mem the filesystem cache has, and so on). Stored fields (to fetch) require two disk seeks. With \_source, you fetch one field, with 50 fields, you fetch 50. When indexing, its similar notion (more file IO).  
On Monday, May 2, 2011 at 3:33 PM, Mustafa Sener wrote:

> Hi,  
> I use ES with version 0.16.0. I tested performance using two mapping configuration with a document having 50 string properties.
> 
> \_source property is disabled, \_all property is disabled and specified store parameter of fields as yes.  
> \_source property is enabled, \_all property is disabled and store parameter of fields as no
> 
> I don't see any significant performance difference between these two in both bulk indexing speed and search speed (I tested search by both specifying two fields and whole field set). Is this an expected result?
> 
> ES cluster and testing java application is on the same PC.  
> I tested by inserting 100000 docs divided to 10 bulk operations. And performed search 1000 times after inserting docs.
> 
> --  
> Mustafa Sener  
> [www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [May 3, 2011, 7:11pm UTC](https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324/3 "2011-05-03T19:11:15Z")

</div>

Thanks

On Tue, May 3, 2011 at 7:13 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> The overhead is pretty simple to understand (1 \_source vs. 50 stored  
> fields), though perf wise, it depends when you will really see it (depends  
> on the concurrency of indexing, how much mem the filesystem cache has, and  
> so on). Stored fields (to fetch) require two disk seeks. With \_source, you  
> fetch one field, with 50 fields, you fetch 50. When indexing, its similar  
> notion (more file IO).
> 
> On Monday, May 2, 2011 at 3:33 PM, Mustafa Sener wrote:
> 
> Hi,  
> I use ES with version 0.16.0. I tested performance using two mapping  
> configuration with a document having 50 string properties.
> 
> 1. \_source property is disabled, \_all property is disabled and  
> specified store parameter of fields as yes.
> 2. \_source property is enabled, \_all property is disabled and store  
> parameter of fields as no
> 
> I don't see any significant performance difference between these two in  
> both bulk indexing speed and search speed (I tested search by both  
> specifying two fields and whole field set). Is this an expected result?
> 
> ES cluster and testing java application is on the same PC.  
> I tested by inserting 100000 docs divided to 10 bulk operations. And  
> performed search 1000 times after inserting docs.
> 
> --  
> Mustafa Sener  
> [www.ifountain.com](http://www.ifountain.com)

--  
Mustafa Sener  
[www.ifountain.com](http://www.ifountain.com)  
WebRep  
Overall rating

---

<div class="post-metadata">

**Author:** ![imaravin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/imaravin/32/9213_2.png) [@imaravin](https://discuss.elastic.co/u/imaravin)\
**Post date:** [June 27, 2017, 2:18pm UTC](https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324/4 "2017-06-27T14:18:20Z")

</div>

Hi,  
I don't have much experience in ES. When I heard about \_source field storing entire document as JSON,  
I tried to store the source as JSON objects inside Lucene Document. While retrieving back. I found the time taken for JSON construction is more than the disk read time. Still, what is the advantage in the \_source field?.  
We can store all the fields in the document to provide better indexing performance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 4:01am UTC](https://discuss.elastic.co/t/performance-difference-between--source-and-fields-with-store/4324/5 "2022-11-04T04:01:24Z")

</div>


