Here's a more complex example, a table and some data. See the table spools in the query execution plan. Thanks for any help, IF...
Hi, I have this query going like this: select * from ( select id, row_number()over(partition by fk_tbl_visits_id order by id desc) as rn...
Hi, I have a log table that saves web visits. And I have this query which is pretty slow : select top 500 count(1) as nbCount, currentPage as...
Hi, I keep wondering what's the best way to create a clustered index. I tried many ways. Some make the query fast even though I think it could be...
Hi, Let's say I have a customer table and an order table. In the order table, I have the customer name. So if I want to select the orders grouped by...
Hi, Finally, after a lots of tests, this is the fastest index (note the include column). It executes the query in 2 seconds. CREATE NONCLUSTERED...
As a mater of fact, the id field is unique. If I understand well, the clustered index should be on increasing values (like date or identity) and it's...
Hi, I have a table logging our website activity with about 60 M of rows. One user has for itself more than 1 M rows. When I do a count(distinct), it...
Well, you know, it's not to reinvent the wheel but to learn how to do high performance applications. It's awesome how Google Analytics can process a...
Hi, I'm trying to build my own web stats tool like Google Analytics. And like them, I'd like to implement a drill down function to segment data on...
@satya Yes, I reindex once a week @Scott Here's the result. What does that tell you?DBCC SHOWCONTIG scanning 'tbl_computedBaseReportLogs' table......
Hi, I have a table with 100 M+ rows. As the table grows, the select queries are getting slower. In the execution plan, everything looks fine since...
Separate names with a comma.