Bug 1073093 - Admin -> Metrics/Alert/Drift query does not scale well

Thomas Segismont tsegismo at redhat.com
Fri Jun 13 09:58:03 UTC 2014


Le 12/06/2014 23:10, Elias Ross a écrit :
> https://bugzilla.redhat.com/show_bug.cgi?id=1073093
>
> I'm curious the best way to solve this.
>
> Adding indexes seem safe, but I'm not sure how to add additional indexes to RHQ.
>
> Do I update modules/core/dbutils/bin/target/classes/db-schema-combined.xml
> or db-upgrade.xml ?

The process for changing DB schema is explained here:
https://docs.jboss.org/author/display/RHQ/Design-ChangingDBSchema

For indexes, use a schema-directSQL node in db-upgrade.xml:

<schema-directSQL>
  <statement desc="Add index bla bla bla">
   CREATE INDEX XXXXX_IDX ON MY_TABLE (column_name)
  </statement>
</schema-directSQL>

Don't forget to update the files for initial setups. For example in 
modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml 
you'll find:

<table name="RHQ_RESOURCE_TYPE">
  <column name="ID" default="sequence-only" initial="10001"
          primarykey="true" required="true" type="INTEGER"/>
...

  <index name="RHQ_RES_TYPE_IDX_PLG_NAME" unique="true">
   <field ref="NAME"/>
   <field ref="PLUGIN"/>
  </index>
</table>

>
> Also, I'm wondering if the query should simply be changed.

I had a very quick look at the BZ but did not get which screen exactly 
is impacted.

Regards,
Thomas


More information about the rhq-devel mailing list