Click here to Skip to main content
15,889,527 members
Home / Discussions / Database
   

Database

 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 23:59
Meysam Mahfouzi27-Jan-09 23:59 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius28-Jan-09 0:21
mentorWendelius28-Jan-09 0:21 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi28-Jan-09 1:07
Meysam Mahfouzi28-Jan-09 1:07 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius28-Jan-09 1:19
mentorWendelius28-Jan-09 1:19 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi28-Jan-09 1:53
Meysam Mahfouzi28-Jan-09 1:53 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius28-Jan-09 2:13
mentorWendelius28-Jan-09 2:13 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi28-Jan-09 2:56
Meysam Mahfouzi28-Jan-09 2:56 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius28-Jan-09 3:12
mentorWendelius28-Jan-09 3:12 
Okay, if it's possible to skip pages, then this won't work. I started to think some kind of pre-pagination, but I think that won't work either...

Hmm, are the news deleted often? Could it be acceptable that if a record is deleted, a time consuming operation is executed?
What I'm thinking is that if we would have a ordinal number on the rows (1,2,3,4...) and we know the maximum at every moment then the page 6 (with 10 news on page) would be from (maximum - (5 * 10)) to (maximum - (6 * 10)) + 1. Now if we create an unique index on the ordinal column we get the maximum very fast and the query will also be very fast. The downside is that if a record is deleted, the ordinals must be rearranged starting from the deleted position to the maximum. However this would be one simple operation (although it may take awhile).

Do you see problems in that solution?

The need to optimize rises from a bad design.My articles[^]

GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi28-Jan-09 3:31
Meysam Mahfouzi28-Jan-09 3:31 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius28-Jan-09 4:16
mentorWendelius28-Jan-09 4:16 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi28-Jan-09 4:38
Meysam Mahfouzi28-Jan-09 4:38 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius28-Jan-09 4:51
mentorWendelius28-Jan-09 4:51 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi24-Jun-09 20:46
Meysam Mahfouzi24-Jun-09 20:46 
Questionsql server group Pin
Nath26-Jan-09 17:36
Nath26-Jan-09 17:36 
AnswerRe: sql server group Pin
Wendelius26-Jan-09 18:28
mentorWendelius26-Jan-09 18:28 
QuestionOracle tnsnames.ora "I guess!!" Pin
Muammar©26-Jan-09 8:06
Muammar©26-Jan-09 8:06 
AnswerRe: Oracle tnsnames.ora "I guess!!" Pin
Wendelius26-Jan-09 8:27
mentorWendelius26-Jan-09 8:27 
GeneralRe: Oracle tnsnames.ora "I guess!!" Pin
Muammar©26-Jan-09 22:31
Muammar©26-Jan-09 22:31 
GeneralRe: Oracle tnsnames.ora "I guess!!" Pin
Wendelius27-Jan-09 2:41
mentorWendelius27-Jan-09 2:41 
QuestionInsert value and select Pin
fly90426-Jan-09 5:01
fly90426-Jan-09 5:01 
AnswerRe: Insert value and select Pin
Wendelius26-Jan-09 5:13
mentorWendelius26-Jan-09 5:13 
QuestionSSIS: How can you read data from hidden Excel worksheets using SSIS? Pin
Red_Wizard_Shot_The_Food26-Jan-09 4:40
Red_Wizard_Shot_The_Food26-Jan-09 4:40 
AnswerRe: SSIS: How can you read data from hidden Excel worksheets using SSIS? Pin
Wendelius26-Jan-09 6:27
mentorWendelius26-Jan-09 6:27 
GeneralRe: SSIS: How can you read data from hidden Excel worksheets using SSIS? Pin
Red_Wizard_Shot_The_Food26-Jan-09 22:29
Red_Wizard_Shot_The_Food26-Jan-09 22:29 
GeneralRe: SSIS: How can you read data from hidden Excel worksheets using SSIS? Pin
Wendelius27-Jan-09 2:44
mentorWendelius27-Jan-09 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.