Re: Replace IN VALUES with ANY in WHERE clauses during optimization

Поиск
Список
Период
Сортировка
Искать
От
Alena Rybakina
Тема
Re: Replace IN VALUES with ANY in WHERE clauses during optimization
Дата
Msg-id
99c3d74c-56c1-4fc1-b6db-c0c87cc9cc2d@postgrespro.ru
Ответ на
Список
Дерево обсуждения
Re: Replace IN VALUES with ANY in WHERE clauses during optimization Alena Rybakina <a.rybakina@postgrespro.ru>
Re: Replace IN VALUES with ANY in WHERE clauses during optimization Ivan Kush <ivan.kush@tantorlabs.com>
On 28.02.2025 14:48, Alena Rybakina wrote:

Hi!

On 21.02.2025 00:09, Alena Rybakina wrote:

Hi!

On 09.02.2025 18:38, Alexander Korotkov wrote:
Also, aren't we too restrictive while requiring is_simple_values_sequence()?
For instance, I believe cases like this (containing Var) could be transformed too.

select * from t t1, lateral (select * from t t2 where t2.i in (values (t1.i), (1)));

I added it and attached a patch with diff file. To be honest, I didn't find queries except for var with volatile functions where the transform can't be applied.

I removed the function volatility check that I added in the previous version, since we already check it in is_simple_values_sequence.

I'm not sure about only cases where var can refer to something outside available_rels list but I couldn't come up with an example where that's possible, what do you think?

Considering it again, I think we can't face problems like that because we don't work with join.

I attached a diff file as a difference with the 3rd version of the patch, when we did not consider the values with var for transformation.

-- 
Regards,
Alena Rybakina
Postgres Professional
В списке pgsql-hackers по дате отправления
От: Dean Rasheed
Дата:
От: Thomas Munro
Дата:
FAQ