Skip to content

Incorrect table name in Meta-Data Schema appendix [BATCH-2853] #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 5, 2019 · 2 comments
Labels
has: backports Legacy label from JIRA. Superseded by "for: backport-to-x.x.x" in: documentation type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 5, 2019

Luigi Quitadamo opened BATCH-2853 and commented

Index suggested in docs (https://docs.spring.io/spring-batch/docs/current/reference/html/schema-appendix.html#recommendationsForIndexingMetaDataTables) doesn't match with tables created by spring batch.

 

Default Table Name Where Clause Frequency MATCH
BATCH_JOB_INSTANCE JOB_NAME = ? and JOB_KEY = ? Every time a job is launched For SqlServer this index already exists (created by constraint)
BATCH_JOB_EXECUTION JOB_INSTANCE_ID = ? Every time a job is restarted  
BATCH_EXECUTION_CONTEXT EXECUTION_ID = ? and KEY_NAME = ? On commit interval, a.k.a. chunk This table doesn't exist
BATCH_STEP_EXECUTION VERSION = ? On commit interval, a.k.a. chunk (and at start and end of step)  
BATCH_STEP_EXECUTION STEP_NAME = ? and JOB_EXECUTION_ID = ? Before each step execution Is it correct the order for index? JOB_EXECUTION_ID is a foreign key so probably a better index should be (JOB_EXECUTION_ID, STEP_NAME)

 

 Furthermore, probably system needs index on BATCH_JOB_EXECUTION_PARAMS.JOB_EXECUTION_ID because it has a foreign key constraint.

 

 


Affects: 3.0.10, 4.2.0, 4.1.1

Referenced from: pull request #748

@fmbenhassine
Copy link
Contributor

Index suggested in docs (...) doesn't match with tables created by spring batch.

There are no indexes suggested in this section, on the contrary, it mentions that DDL scripts do not include indexes:

Index declarations are not included in that DDL,  because there are too many
variations in how users may want to index, [..].
The following provides **some indication** [..], so that individual projects
can make up their own minds about indexing

So based on this statement, I would leave any decision about indexing to the user.

That said, I agree on the following:

BATCH_EXECUTION_CONTEXT | This table doesn't exist

Indeed, this table does not exist anymore (it has been removed in d272105#diff-9df3d792ac9c1d09e598d04018ee1f6eL71-L80). So the documentation should be updated accordingly (there is a PR for that, see #748).

@fmbenhassine fmbenhassine added type: bug and removed status: waiting-for-triage Issues that we did not analyse yet type: task labels Feb 28, 2020
@fmbenhassine fmbenhassine added this to the 4.3.0 milestone Feb 28, 2020
@fmbenhassine fmbenhassine changed the title Suggested index doesn't match with tables [BATCH-2853] Incorrect table name in Meta-Data Schema appendix [BATCH-2853] Feb 28, 2020
@fmbenhassine fmbenhassine added the has: backports Legacy label from JIRA. Superseded by "for: backport-to-x.x.x" label Feb 28, 2020
This was referenced Mar 3, 2020
@fmbenhassine
Copy link
Contributor

Fixed in #748 and backported to 4.2.2 and 4.1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: backports Legacy label from JIRA. Superseded by "for: backport-to-x.x.x" in: documentation type: bug
Projects
None yet
Development

No branches or pull requests

2 participants