View Issue Details

IDProjectCategoryView StatusLast Update
0002084mantisbtsqlpublic2024-10-03 08:03
ReporterjctAssigned Todregad  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionno change required 
Summary0002084: Use bug id column to refer to bug_text record
Description

In the mantis_bug_table, is the "id" field always the same as the "bug_text_id" field ?

If it is, a small optimization could be done in bug_delete.php :
$c_bug_text_id = (integer)$f_bug_text_id; which is used once could no more be used and replaced bu the $c_id var.

Please correct me if I'm wrong !

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
child of 0004181 closed Features in Mantis 1.1 release 

Activities

jfitzell

jfitzell

2002-08-21 17:49

reporter   ~0003145

Last edited: 2002-08-21 17:54

yeah, this seems like a one-to-one relationship to me...

I assume it was put in a separate table so that SELECT * on the bug_table would be faster. Not sure how often we need enough information to make listing the fields individually a pain, but don't need the text fields.

I don't know the history on this one so I don't know if it's still an issue or if we could move it into the same table. Anyone else know? Ken?

Not sure the optimization suggested in the bug will make much difference in speed and without a formal FOREIGN KEY specification, it seems a little "wrong"

edited on: 08-21 17:54

jlatour

jlatour

2004-08-08 10:17

reporter   ~0006817

It is not always the same, but should be a one-to-one relationship. We could look into changing the database structure to reflect this.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036383

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

grangeway

grangeway

2014-09-22 15:36

reporter   ~0041275

Pull Request to fix this issue is in github

dregad

dregad

2024-09-23 08:57

developer   ~0069257

As mentioned in 0002084:0006817, there is indeed a 1:1 relationship between mantis_bug_table and mantis_bug_text_table.

In theory, id and bug_text_id should be equal, but in practice they may differ. For example in this tracker, as of this writing we see

  • 5845 records with an offset of 1, starting with 0015572 (bug_text_id = 15573)
  • 1064 records with an offset of 2, starting with #28128 (bug_text_id = 28130)

I see no value in changing the database structure, for an "optimization" that would not bring any noticeable improvement, especially considering that, since commit MantisBT master aa5f56b3, bug_delete() function only works based on bug_id, and bug_text_id is retrieved from the bug table.

Resolving as no change required.