I'm taking over a very small niche classifieds site (maybe 5 new entries a day) which runs fine until Google and Bing hit it. Every category, subcategory, and ad is stored in the database (MS SQL 2005) so each page they crawl hits these queries and spikes the CPU.

To combat this my boss wants me to offload all the data into XML files and query those instead (whaa?). I think this has to be a lot more work than necessary but being an amateur DBA at best I don't have any solid alternatives other than tuning queries, using stored procedures, creating proper indexes, etc...

Is there any basis to the XML argument? What would you do to dodge this spider issue?

Category:

```
SELECT Category.CatID, Category.CatName, Category.Remove, CategorySub.SubCatID, CategorySub.SubCatName, CategorySub.TitleText, CategorySub.ShowPrice, CategorySub.ShowLocation, CategorySub.Remove
FROM Category INNER JOIN CategorySub ON Category.CatID = CategorySub.CatID
WHERE (((Category.Remove)=0) AND ((CategorySub.SubCatID)=" & intSubCatID & ") AND ((CategorySub.Remove)=0))

```

Subcategory:

```
SELECT CategorySub.CatID, CategorySub.SubCatName, CategorySub.SubCatOrder, CategorySub.SubCatID, CategorySub.Remove FROM CategorySub
WHERE (((CategorySub.CatID)=" & intCatID & ") AND ((CategorySub.Remove)=0))
ORDER BY CategorySub.SubCatOrder

```

Ads:

```
SELECT Ad.AdID, Ad.ModifiedDate, Ad.CatID, CategorySub.SubCatName, Ad.Title, Ad.ShortDesc, Ad.Price, Ad.Location, Count(Pictures.PictureID) AS CountOfPictureID
FROM (Ad INNER JOIN CategorySub ON Ad.SubCatID = CategorySub.SubCatID) LEFT JOIN Pictures ON Ad.AdID = Pictures.AdID
WHERE (((Ad.SubCatID)=" & intSubCatID & ") AND ((Ad.Activated)<>0) AND ((Ad.Remove)=0))
GROUP BY Ad.AdID, Ad.ModifiedDate, Ad.CatID, CategorySub.SubCatName, Ad.Title, Ad.ShortDesc, Ad.Price, Ad.Location
ORDER BY Ad.ModifiedDate DESC

```