# Should setting op\_type = create on the \_bulk API be faster than index?

**URL:** <https://discuss.elastic.co/t/should-setting-op-type-create-on-the-bulk-api-be-faster-than-index/356710>\
**Category:** Elasticsearch\
**Created:** [April 3, 2024, 6:10pm UTC](https://discuss.elastic.co/t/should-setting-op-type-create-on-the-bulk-api-be-faster-than-index/356710 "2024-04-03T18:10:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pingo](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pingo](https://discuss.elastic.co/u/pingo)\
**Post date:** [April 3, 2024, 6:10pm UTC](https://discuss.elastic.co/t/should-setting-op-type-create-on-the-bulk-api-be-faster-than-index/356710/1 "2024-04-03T18:10:21Z")

</div>

Hi there!

We have some indices using datastreams so we have to set op\_type to create in logstash. But for other append-only non-datastream indices, is there any performance benefit to setting it there aswell?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 6, 2024, 7:51am UTC](https://discuss.elastic.co/t/should-setting-op-type-create-on-the-bulk-api-be-faster-than-index/356710/2 "2024-04-06T07:51:00Z")

</div>

No, I do not think there is. If you are letting Elasticsearch set the document IDs this is as far as I know already optimised to be handles the same way a create is (Elasticsearch knows the document does not already exist). If you on the other hand are setting your own IDs Elasticsearch still has to check if the document already exists so would not reduce the amount of work, just cause failures if the document alraeady exists.

---

<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:** [May 4, 2024, 7:51am UTC](https://discuss.elastic.co/t/should-setting-op-type-create-on-the-bulk-api-be-faster-than-index/356710/3 "2024-05-04T07:51:27Z")

</div>

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