This repository was archived by the owner on Dec 3, 2019. It is now read-only.
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
Convert paramter to wrong type , and causes very large performances problems #254
Closed
Description
classOf[Int] -> (IntegerEncoderDecoder -> ColumnTypes.Numeric),
classOf[java.lang.Integer] -> (IntegerEncoderDecoder -> ColumnTypes.Numeric),
classOf[java.lang.Short] -> (ShortEncoderDecoder -> ColumnTypes.Numeric),
classOf[Short] -> (ShortEncoderDecoder -> ColumnTypes.Numeric),
classOf[Long] -> (LongEncoderDecoder -> ColumnTypes.Numeric),
classOf[java.lang.Long] -> (LongEncoderDecoder -> ColumnTypes.Numeric),
Convert Integer、Long、Short、Float and Double to Numeric , and the attribute of table is Integer or Long, If you use preparedStatement , and will causes larger performances problems.
e.g
Having table users, and has attribute uid with primary key.
- use statment and find searching by index
explain analyse select * from users where uid in (200,500,800);
- use preparedStatement with correct paramter type, and find searching by index
PREPARE fooplan (int, int, int) AS
select *
from users
where uid in ($1, $2, $3);
explain analyse EXECUTE fooplan(200, 500, 800);
- use preparedStatement with wrong paramter type, and find searching by seq
PREPARE fooplan1 (numeric, numeric, numeric) AS
select *
from users
where uid in ($1, $2, $3);
explain analyse EXECUTE fooplan1(200, 500, 800);
Metadata
Metadata
Assignees
Labels
No labels