Add support for IN-lists padding to better reuse cached statements

Description

As described in this Twitter thread, we could add a new feature which generates power-of-2 IN lists so we get a better chance of reusing the execution plan, especially on Oracle and SQL Server.

So, let's assume we have the following 3 SELECT queries executed:

We can rewrite them as:

This way we reuse the same cached statement:

Environment

None

Status

Assignee

Vlad Mihalcea

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure