[invalid] Content index created on wrong column?

Post Reply
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

[invalid] Content index created on wrong column?

Post by fredp »

Hi,

While investigating a possible upgrade issue in beta1, I noticed something curious about the new cms_index_content_by_idhier index creation code. I could be wrong, but I'm guessing the following code should be using the column id_hierarchy instead of hierarchy:
install/upgrades/upgrade.35.to.36.php wrote:$sqlarray = $dbdict->CreateIndexSQL($db_prefix.'index_content_by_idhier', $db_prefix."content", 'hierarchy');
$return = $dbdict->ExecuteSQLArray($sqlarray);
$ado_ret = ($return == 2) ? ilang('done') : ilang('failed');
echo ilang('install_creating_index', 'content', $ado_ret);
install/schemas/schema.php wrote: $sqlarray = $dbdict->CreateIndexSQL($db_prefix.'index_content_by_hierarchy', $db_prefix."content", 'hierarchy');
$return = $dbdict->ExecuteSQLArray($sqlarray);
$ado_ret = ($return == 2) ? ilang('done') : ilang('failed');
echo ilang('install_creating_index', 'content', $ado_ret);

$sqlarray = $dbdict->CreateIndexSQL($db_prefix.'index_content_by_idhier', $db_prefix."content", 'hierarchy');
$return = $dbdict->ExecuteSQLArray($sqlarray);
$ado_ret = ($return == 2) ? ilang('done') : ilang('failed');
echo ilang('install_creating_index', 'content', $ado_ret);
Hope this helps,
fredp
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Content index created on wrong column?

Post by calguy1000 »

No, it's not the wrong column. sorry.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: [invalid] Content index created on wrong column?

Post by fredp »

Ok, I stand corrected. But, I am curious, is there some advantage to having two identical single-column indexes on the same column, hierarchy?
  • cms_index_content_by_hierarchy
  • cms_index_content_by_idhier
I'm more familiar with Oracle than MySQL, but I would think duplicate indexes would generally slow things down on the db server:
  • More disk space for db and db backups
  • More query plans to consider during optimizer phase
  • Extra work on inserts, updates, and deletes
Thanks

Edit: Added reasons for my concern
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
Post Reply

Return to “Closed Issues”