Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
Slow Speed In read Data By This SQL |
Mon, Apr 27 2009 2:06 PM | Permanent Link |
Kianian.mehrdad@gmail.com | Hi,
I Use ElevateDB Standalone Edition This SQL needs 5 to 10 Second time to return result : rows count are 300 Select * , (Select Count(*) from student where stid > 0 ) as Count1 , (Select Count(*) from student where stid > 50 ) as Count2 , (Select Count(*) from student where stid > 100 ) as Count3 , from student order by stid |
Tue, Apr 28 2009 12:31 PM | Permanent Link |
"James Relyea" | > This SQL needs 5 to 10 Second time to return result :
> rows count are 300=20 >=20 > Select * , > (Select Count(*) from student where stid > = 0 ) as Count1 , > (Select Count(*) from student where stid > = 50 ) as Count2 , > (Select Count(*) from student where stid > = 100 ) as Count3 , > from student=20 > order by stid I'm not sure if this would change anything, but have you tried this as = an alternate? I intentionally dropped the sort. Select * , (Select Count(stid) from student where stid = > 0 ) as Count1 , (Select Count(stid) from student where stid = > 50 ) as Count2 , (Select Count(stid) from student where stid = > 100 ) as Count3 , from student=20 jr |
Tue, Apr 28 2009 2:37 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | << I Use ElevateDB Standalone Edition
This SQL needs 5 to 10 Second time to return result : rows count are 300 >> Is there an index on the stid column in the student table ? -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Apr 29 2009 4:06 AM | Permanent Link |
mkalone@gmail.com | Sorry This is The Main SQL :
Select * , (Select Count(*) from SMSNumbers where SMSNumbers .messageId_fk = Messages.Id ) as CountAll , (Select Count(*) from SMSNumbers where SMSNumbers .messageId_fk = Messages.Id AND status = 3) as CountSuccessed , (Select Count(*) from SMSNumbers where SMSNumbers .messageId_fk = Messages.Id AND status = 2) as CountFailed from Messages order by Id desc We Have 2 Tables : SMSNumbers , Messages SMSNumber Contains 3000 to 3000000 record per Messages Table Record When I Run The Count Individually no problem but in this SQL Syntax has low Speed. Tow Tables has Primary KEY |
Wed, Apr 29 2009 4:15 AM | Permanent Link |
mkalone@gmail.com | Solved.
when i add Foreign Key Constraint, My Query runs quick. |
Wed, Apr 29 2009 2:17 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | << Solved. when i add Foreign Key Constraint, My Query runs quick. >> Yes, you were probably missing an index on the messageId_fk column in the SMSNumbers table. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |