# Computing value from query or storing every required field from starting which one is better?

**URL:** <https://discuss.elastic.co/t/computing-value-from-query-or-storing-every-required-field-from-starting-which-one-is-better/95120>\
**Category:** Elasticsearch\
**Created:** [July 31, 2017, 5:54am UTC](https://discuss.elastic.co/t/computing-value-from-query-or-storing-every-required-field-from-starting-which-one-is-better/95120 "2017-07-31T05:54:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhav\_goel](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@vaibhav\_goel](https://discuss.elastic.co/u/vaibhav_goel)\
**Post date:** [July 31, 2017, 5:54am UTC](https://discuss.elastic.co/t/computing-value-from-query-or-storing-every-required-field-from-starting-which-one-is-better/95120/1 "2017-07-31T05:54:37Z")

</div>

i am using arithmetic operation on two fields using script in my aggregation. Whether I should continue this or compute those value and stored them to my es and directly apply my aggregation on those fields . Which would be the better way ???

---

<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:** [August 28, 2017, 5:54am UTC](https://discuss.elastic.co/t/computing-value-from-query-or-storing-every-required-field-from-starting-which-one-is-better/95120/2 "2017-08-28T05:54:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
