# Performance concern on OVER() function

**URL:** <https://community.dremio.com/t/performance-concern-on-over-function/5856>\
**Category:** Uncategorized\
**Created:** [July 6, 2020, 9:58am UTC](https://community.dremio.com/t/performance-concern-on-over-function/5856 "2020-07-06T09:58:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasoncai](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jasoncai](https://community.dremio.com/u/jasoncai)\
**Post date:** [July 6, 2020, 9:58am UTC](https://community.dremio.com/t/performance-concern-on-over-function/5856/1 "2020-07-06T09:58:08Z")

</div>

Is it any performance concern to use the window function OVER() ?

Why I asked this is because we have a SQL query which uses the over() had experienced bad performance during period of time. But later then, the query is fast again. Maybe the slowness was also due to the overload of the system at that time (lots of processes were using dremio at that time)

So I would like to learn if there is any performance concern to use over() in dremio ? Our query is just simple use case like: this table is partitioned on column4  
select \* from (  
select column1, row\_number() over (partition by column2 order by column3) rowNum  
from table  
where column1 in ()  
and column4 = ‘2020-06-01’  
) t  
and t.rowNum = 1

The question is:

1. will this kind of over() use case cause any performance issue?
2. will this kind of query which is using over() be much slower when the dremio cluster lack of resources? (I mean if the query is slow at some timing, is the over() the main and root cause?)
3. is there any suggestion/best practice to use the over() to gain the best performance?

As dremio is unlike RDBMS, please help advise on it. Thanks.

---

<div class="post-metadata">

**Author:** ![Rakesh\_Malugu](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/rakesh_malugu/32/2384_2.png) [@Rakesh\_Malugu](https://community.dremio.com/u/Rakesh_Malugu)\
**Post date:** [July 6, 2020, 11:38am UTC](https://community.dremio.com/t/performance-concern-on-over-function/5856/2 "2020-07-06T11:38:24Z")

</div>

Hello @jasoncai

Can you attach both the query profiles that ran slow and fast?

We need to figure it out what caused the slowness in the first run.

Thanks,  
@Rakesh_Malugu
