I have a talk with Alex Stanev about known issue that block indexes - bad param types
postgres=# do $$ declare _id numeric = 777722; begin perform * from bigtable where a = _id; end; $$; DO Time: 108,775 ms postgres=# do $$ declare _id numeric = 777722; begin perform * from bigtable where a = _id; end; $$; DO Time: 106,111 ms postgres=# do $$ declare _id int = 777722; begin perform * from bigtable where a = _id; end; $$; DO Time: 1,522 ms postgres=# do $$ declare _id numeric = 777722; begin perform * from bigtable where a = _id; end; $$; DO Time: 108,287 ms
Is possible to write a extension, that raise warning so index is not possible due bad parameter type, or so cast will be performed on every row?
It can be started like autoexplain.
Regards
Pavel
Есть вопросы? Напишите нам!
✖
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера