Adding Index to RMSHeadquarters tables

I have a custom SQL script that reads the PurchaseOrder and PurchaseOrderEntry tables from the RMS Headquarters database. It does a join using StoreID and PurchaseOrderID. However, it does not appear that there is an index on these fields in Headquarters, so my query takes a long time.

I would like to add indexes to these tables, which should speed up my query. What are the potential pitfalls of adding a custom index to an RMS table? Will the Reindex in Headquarters Administrator include that custom index when it does it's thing?

Reply to
Bill Yater
Loading thread data ...

Well, I don't have an answer to your question if adding an index to a table / tables will jack up RMS - it might, it might not.

Play it safe and create a view with your same query - if its a complex query, the view will "remember" the path it took to display results the first time, so it should run quicker than querying the tables with the same query over and over again.

the syntax to create a view is

CREATE VIEW vw_MyView AS

**your query here**

the name of your view can be whatever you want - its usually a good idea to preface view names with a v or VIEW or vw_ so others will be able to identify as a view by looking at the name.

run the view just as you would query a table

select * from vw_MyView

you can query select columns from the view as well

select col1, col2, col4 from vw_MyView

You can also add the view to standard RMS reports; views have saved my bacon a few times - they're great, and go easy on the database.

H> I have a custom SQL script that reads the PurchaseOrder and

Reply to
convoluted

I have a custom SQL script that reads the PurchaseOrder and PurchaseOrderEntry tables from the RMS Headquarters database. It does a join using StoreID and PurchaseOrderID. However, it does not appear that there is an index on these fields in Headquarters, so my query takes a long time.

I would like to add indexes to these tables, which should speed up my query. What are the potential pitfalls of adding a custom index to an RMS table? Will the Reindex in Headquarters Administrator include that custom index when it does it's thing?

-- Bill Yater Blue Horseshoe Solutions snipped-for-privacy@bhsolutions.com

Reply to
cptsoft

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.