Click here to Skip to main content
16,004,452 members
Home / Discussions / Database
   

Database

 
QuestionSlow query when using @variable in Where clause [modified] Pin
Meysam Mahfouzi27-Jan-09 4:06
Meysam Mahfouzi27-Jan-09 4:06 
AnswerRe: Slow query when using @variable in Where clause Pin
Rob Philpott27-Jan-09 4:25
Rob Philpott27-Jan-09 4:25 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 8:18
Meysam Mahfouzi27-Jan-09 8:18 
GeneralRe: Slow query when using @variable in Where clause [modified] Pin
Meysam Mahfouzi27-Jan-09 20:45
Meysam Mahfouzi27-Jan-09 20:45 
GeneralRe: Slow query when using @variable in Where clause Pin
Rob Philpott27-Jan-09 23:49
Rob Philpott27-Jan-09 23:49 
AnswerRe: Slow query when using @variable in Where clause Pin
Ben Fair27-Jan-09 4:43
Ben Fair27-Jan-09 4:43 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 8:21
Meysam Mahfouzi27-Jan-09 8:21 
GeneralRe: Slow query when using @variable in Where clause Pin
Ben Fair27-Jan-09 10:50
Ben Fair27-Jan-09 10:50 
AnswerRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 4:58
mentorWendelius27-Jan-09 4:58 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 8:14
Meysam Mahfouzi27-Jan-09 8:14 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 8:36
mentorWendelius27-Jan-09 8:36 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 9:09
Meysam Mahfouzi27-Jan-09 9:09 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 9:34
mentorWendelius27-Jan-09 9:34 
GeneralRe: Slow query when using @variable in Where clause [modified] Pin
Meysam Mahfouzi27-Jan-09 20:40
Meysam Mahfouzi27-Jan-09 20:40 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 20:49
mentorWendelius27-Jan-09 20:49 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 21:02
Meysam Mahfouzi27-Jan-09 21:02 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 21:28
mentorWendelius27-Jan-09 21:28 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 22:41
Meysam Mahfouzi27-Jan-09 22:41 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 22:59
mentorWendelius27-Jan-09 22:59 
GeneralRe: Slow query when using @variable in Where clause Pin
Meysam Mahfouzi27-Jan-09 23:11
Meysam Mahfouzi27-Jan-09 23:11 
GeneralRe: Slow query when using @variable in Where clause Pin
Wendelius27-Jan-09 23:23
mentorWendelius27-Jan-09 23:23 
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 
Maysam Mahfouzi wrote:
when I want to alter the current News table, it tells me that the columns is non-deterministic


Could you post the script for the News table.

Maysam Mahfouzi wrote:
I didn't get the concept of multiplying Culture by 100000000


The idea is to create a single column which orders the culture and date columns together. To combine those columns to a single column and to have unique values I converted the date to float so that I can add culture to it. However since Cultures are 1,2,3... I cannot add them to the date since it would change the "date portion" of the float so I decided to multiply the culture with a number big enough so that it won't get mixed with the date.
For example if I would add a new record to the new right now with culture 1 the result would be 100039839.592728. After that I can use these numbers as "pointers" to rows to define a specific starting point to the query. This eliminates the need to read previous records. So what I'm after is that if you have selected news page by page, the next query can always start from the exact point where the last record came from.

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

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.