# createdAt timestamp alternatives

**URL:** <https://discuss.elastic.co/t/createdat-timestamp-alternatives/135698>\
**Category:** Elasticsearch\
**Created:** [June 13, 2018, 11:17am UTC](https://discuss.elastic.co/t/createdat-timestamp-alternatives/135698 "2018-06-13T11:17:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SebScoFr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebscofr/32/31623_2.png) [@SebScoFr](https://discuss.elastic.co/u/SebScoFr)\
**Post date:** [June 13, 2018, 11:17am UTC](https://discuss.elastic.co/t/createdat-timestamp-alternatives/135698/1 "2018-06-13T11:17:30Z")

</div>

I know this has been discussed already on previous threads, though our use-case might be a bit specific.

We have a product import process that runs on a daily basis and saves a bunch of products into an ES index (~5M items).  
Every day some new products are coming in, but 99% of them are just existing products being updated.

One requirement that we have is that we need to keep track of when a product was first imported.  
So far we are handling it by doing a **scripted upsert** : if the product already exists then don't touch the createdAt field otherwise populate it.  
So this works but it turns out that the scripted upsert method is actually about 5 times slower then a normal doc as upsert method according to the metrics I get from xpack monitoring.

Unfortunately, ES does not support indexing time timestamp creation natively anymore, but is using a script to handle this the only option that we have, and if so does it mean we are stuck with a slow indexing rate while doing so? I've tried every [indexing speed tuning recommendations](https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html) with no success.

---

<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 11, 2018, 11:17am UTC](https://discuss.elastic.co/t/createdat-timestamp-alternatives/135698/2 "2018-07-11T11:17:37Z")

</div>

Closed on July 11, 2018, 11:17am UTC

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