Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Performance with ORDER BY + AND in sqlite

Author  Topic 

FredFoobar
Starting Member

1 Post

Posted - 2011-11-05 : 10:46:10

I'm experiencing some weird behavior with SELECT statements in sqlite. There is one table with 3 Million records. E.g.
    SELECT * FROM table1 WHERE cond1; 
reduces the output to 10000 records and finishes instantly. Same with
    SELECT * FROM table1 WHERE cond1 ORDER BY col1; 
and
    SELECT * FROM table1 WHERE cond1 AND cond2 
BUT:
    SELECT * FROM table1 WHERE cond1 AND cond2 ORDER BY col1; 
seems to take forever. The CPU is working for about 2 seconds and after that there is only I/O. CPU does nothing, memory is free.

What am I doing wrong? Thx for help!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-05 : 13:02:55
can you analyse execution plans in three cases and find out costly step in third case?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-11-05 : 14:40:59
SQLite? As in the database library for .net? Or a client for MS SQL Server?

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -