# Query.timeout.sec Does the setting work normally?

**URL:** https://community.questdb.com/t/query-timeout-sec-does-the-setting-work-normally/188
**Category:** Community
**Tags:** question
**Created:** [September 30, 2024, 1:12am UTC](https://community.questdb.com/t/query-timeout-sec-does-the-setting-work-normally/188 "2024-09-30T01:12:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![allen](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@allen](https://community.questdb.com/u/allen)
#### Post date: [September 30, 2024, 1:12am UTC](https://community.questdb.com/t/query-timeout-sec-does-the-setting-work-normally/188/1 "2024-09-30T01:12:42Z")

</div>

“principal=admin, cache=false, jit=false, time=5924508, msg=[-1] timeout, query aborted, errno=-1, ​​pos=0]” The error occurs, but the time specified as time is a long time. It appears to have worked. My current setting is 60 seconds.

---

<div class="post-metadata">

### Author: ![nwoolmer](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/nwoolmer/32/24_2.png) [@nwoolmer](https://community.questdb.com/u/nwoolmer)
#### Post date: [September 30, 2024, 3:25pm UTC](https://community.questdb.com/t/query-timeout-sec-does-the-setting-work-normally/188/2 "2024-09-30T15:25:15Z")

</div>

Hi @allen ,

Please could you add a bit more context? The `time=` number comes from a nanosecond clock.

---

<div class="post-metadata">

### Author: ![allen](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@allen](https://community.questdb.com/u/allen)
#### Post date: [October 2, 2024, 4:36am UTC](https://community.questdb.com/t/query-timeout-sec-does-the-setting-work-normally/188/3 "2024-10-02T04:36:46Z")

</div>

I tried to compile the trade information collected in seconds in September. However, since there was too much data collected, I had to repeat the process for each symbol.

### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: timeout, query aborted

Position: 1

### The error may exist in file [/opt/apache-tomcat-9.0.65/webapps/ROOT/WEB-INF/classes/mapper/qdb/TrafficRepository.xml]

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL:

```auto
INSERT INTO trade_month
SELECT timestamp_floor('m', ts) ts , symbol, sum(side) side, sum(price) price, sum(amount) amount
FROM trade
WHERE ts >= '2024-09-01T00:00:00.000000Z'
AND ts < '2024-10-01T00:00:00.000000Z'
AND symbol = :vSymbol
;

```

### Cause: org.postgresql.util.PSQLException: ERROR: timeout, query aborted

Position: 1  
; uncategorized SQLException; SQL state [00000]; error code [0]; ERROR: timeout, query aborted  
Position: 1; nested exception is org.postgresql.util.PSQLException: ERROR: timeout, query aborted  
Position: 1  
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)  
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)  
at com.sun.proxy.$Proxy191.insert(Unknown Source)  
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)  
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)  
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)  
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)  
at com.sun.proxy.$Proxy206.insertTrafficDstHourly(Unknown Source)  
at kr.co.noas.ms.service.SessionCategoryService.lambda$addTasksByOrgId$36(SessionCategoryService.java:836)  
at kr.co.noas.ms.service.SessionCategoryService.lambda$runTasks$0(SessionCategoryService.java:99)  
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)  
at kr.co.noas.ms.service.SessionCategoryService.runTasks(SessionCategoryService.java:92)  
at kr.co.noas.ms.service.SessionCategoryService.insertHourlyStatisticsByMybatis(SessionCategoryService.java:812)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.base/java.lang.reflect.Method.invoke(Method.java:566)  
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)  
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)  
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:95)  
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)  
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)  
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)  
at java.base/java.lang.Thread.run(Thread.java:829)  
Caused by: org.postgresql.util.PSQLException: ERROR: timeout, query aborted  
Position: 1  
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2565)  
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2297)  
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:322)  
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481)  
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401)  
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)  
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:153)  
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)  
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)  
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)  
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)  
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)  
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)  
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)  
at jdk.internal.reflect.GeneratedMethodAccessor330.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.base/java.lang.reflect.Method.invoke(Method.java:566)  
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)  
at kr.co.noas.ms.configuration.TimezoneInterceptor.intercept(TimezoneInterceptor.java:54)  
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)  
at com.sun.proxy.$Proxy238.update(Unknown Source)  
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)  
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)  
at jdk.internal.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.base/java.lang.reflect.Method.invoke(Method.java:566)  
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)  
… 24 common frames omitted

---

<div class="post-metadata">

### Author: ![nwoolmer](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/nwoolmer/32/24_2.png) [@nwoolmer](https://community.questdb.com/u/nwoolmer)
#### Post date: [October 7, 2024, 12:29pm UTC](https://community.questdb.com/t/query-timeout-sec-does-the-setting-work-normally/188/4 "2024-10-07T12:29:12Z")

</div>

I’m not sure what the question is! But as you say, if you are getting timeouts, you can either up the limit, or you can select less data and paginate.
