Query Profile script