Skip to content

Performance problem when using params on select query #1501

@guenterhagedorn

Description

@guenterhagedorn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions