Slow Select PreparedStatement

Asked 1 years ago, Updated 1 years ago, 81 views

Utilize JDBC in large amounts of data
data Slow select of PreparedStatement method (?Bind mode)
SQL improvement or no binding mode?

Retrieves the search results from the search criteria on the screen.
You must meet the following prerequisites:

遅い Reason for delay: When planning an execution plan, the fastest plan is not utilized because the data bound cannot be predicted.

java jdbc

2022-09-30 21:13

1 Answers

What DB are you using?

Some DBs use the syntax SELECT...FROM...WITH(Index(index_name)).(e.g. MS SQL Server)

MySQL uses the following syntax

SELECT* FROM table 1 USE INDEX (col1_index, col2_index)
  WHERE col1 = 1 AND col2 = 2 AND col3 = 3;

SELECT* FROM table 1 IGNORE INDEX (col3_index)
  WHERE col1 = 1 AND col2 = 2 AND col3 = 3;

ORACLE delivers index tips in comment format, but JDBC was not able to deliver them after trying them a long time ago.I defined it in VIEW or PL/SQL.


2022-09-30 21:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.