Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.


As i understand the overall poolsize of the prepared statements is 65535 + (number of connections * 20). Is it possible to enlarge this by for instance adjusting the pagesize, now 4096?

Connected users: 2023 select db_property('prepstmt') returns 90346. pagesize 4096

SQL Anywhere Windows2012R2

asked 25 Mar '19, 07:50

Inforit_Marc's gravatar image

accept rate: 0%

It appears the maximum is not adjustable: Number of concurrent statements per database server 20 x number-of-database-connections + 65534

( 2023 * 20 ) + 65534 = 105994... so is that a problem, if you're only using 90346?

Is it possible you have some runaway connections that are preparing zillions of single-use statements and not freeing anything?

What is the max_statement_count option set to? (the default is 50)

Are all 2023 connections active? or are many connections asleep on the couch, bloated up with prepared statements :)

(25 Mar '19, 09:39) Breck Carter

Hi Breck,

Thanks a lot for your input.

The application is a softvelocity clarion 9.1 windows application. Connection DB by ODBC, we have no idle time mechanism, no max statement/cursor count. The number of users has grown. I cannot find a logical way to have influence. It seems opening and closing a bunch of files starting the application has a positive effect, but do not have this in production yet. I found out that opening an application window generates eg 100 prepared statements. Closing this window drops (most) of these statements and opening the same window for the 2nd time only generates a few prepared statements for that connection.

Is it possible you have some runaway connections that are preparing >zillions of single-use statements and not freeing anything?

I don't think so. It seems just a lot of prepared statement are generated by the application.


It is set to 0, default 50 is too low. If I take a look at the connections most of them are below 250, but some threads just need almost 250..

Are all 2023 connections active

Not all the time. From the main window people start threads (window), and leave these open while working in other threads (windows). Not all threads get a new connection, but 1 user has more connections to the DB.

If i only could just clear prepared statements of some connections using a scheduled stored function, of enlarge the pool somehow. Disconnecting connectiosn will result in application errors, and thus angry users.



(25 Mar '19, 10:17) Inforit_Marc
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 25 Mar '19, 07:50

question was seen: 1,028 times

last updated: 25 Mar '19, 10:17