# SQL query's, where do the come from?

**URL:** <https://forum.inductiveautomation.com/t/sql-querys-where-do-the-come-from/9251>\
**Category:** Ignition\
**Created:** [October 29, 2014, 3:14pm UTC](https://forum.inductiveautomation.com/t/sql-querys-where-do-the-come-from/9251 "2014-10-29T15:14:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thierryv](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@thierryv](https://forum.inductiveautomation.com/u/thierryv)\
**Post date:** [October 29, 2014, 3:14pm UTC](https://forum.inductiveautomation.com/t/sql-querys-where-do-the-come-from/9251/1 "2014-10-29T15:14:28Z")

</div>

Greetings,

I see a lot of query’s on our MSQL that take above 1 second to execute.  
All of them looks like the one below, except that the values are different of course.  
Can someone tell me what is going on?

```auto
declare @p1 int
set @p1=3636000
exec sp_prepexec @p1 output,N'@P0 int,@P1 int,@P2 bigint',N'SELECT TOP 1 "tagid","intvalue","floatvalue","stringvalue","datevalue","t_stamp","dataintegrity" FROM sqlt_data_1_2014_10 WHERE "tagid" IN (@P0,@P1) and "t_stamp"<@P2 ORDER BY "t_stamp" DESC ',296,9,1414595397310
select @p
```
