# Question about counting performance

**URL:** <https://discuss.elastic.co/t/question-about-counting-performance/13411>\
**Category:** Elasticsearch\
**Created:** [August 30, 2013, 2:55pm UTC](https://discuss.elastic.co/t/question-about-counting-performance/13411 "2013-08-30T14:55:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [August 30, 2013, 2:55pm UTC](https://discuss.elastic.co/t/question-about-counting-performance/13411/1 "2013-08-30T14:55:42Z")

</div>

We have a document type that has links to other documents of the same  
type. We want to store the number of links to each document on the  
document itself. We can get those counts out of the source system (MySQL)  
but they are slow.

Does anyone have a gut feeling about loading all the documents into  
Elasticsearch, forcing a refresh, and then updating all the counts in a  
second pass using count queries against Elasticsearch? I _think_ it'd be  
faster than waiting on MySQL.

We'd be able to use the count query method on incremental updates without  
as well without worrying about a second pass which would be nice. We'd  
have to work around refreshes but that shouldn't be too much of a problem.

Nik Everett

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:18am UTC](https://discuss.elastic.co/t/question-about-counting-performance/13411/2 "2017-07-06T02:18:45Z")

</div>

Closed on July 6, 2017, 2:18am UTC


