Performance problem when using params on select query
guenterhagedorn opened this issue · 3 comments
PHP version 8.1.27
PDO_SQLSRV version 5.11.1
Microsoft ODBC Driver version 18.3.2.1
SQL Server version 15.00.4345
Client operating system WS2019
Problem description
This one is actually hard to describe or set up a test case: I have a simple SELECT statement with some LEFT JOINS and
a few params incluing one with LIKE '%searchterm%'
When using the query directly incl. params in SSMS or with PDO, the query returns the result in under 1 second.
When using $stmt->execute($bindings) or using $stmt->bindValue(...) instead, it needs about 20 seconds.
This is the case only for one or two of my queries, most other (around 800) are working fine.
I was hesitant to post this here, but after all my testing I am sure it must be something with the binding.
Without reproduction steps, I'm not sure how we would investigate this issue
Yes, I perfectly understand. I am trying to find a case to reproduce it, but since this works fine for 99% of all my queries and with not understanding why this works fine without params and is slow with params, it's hard to find a way to build a test scenario. :( I can offer that someone can check it via teamviewer or so, but other than that - no idea at the moment.
Closed due to inactivity