c# - sqlite index on strings columns -


i have query. it's taking 1100 ms don't think should.

select * pageinfo url = @url or url @url2 

the url /sub/id , /sub2/id/thing. have index on pageinfo(url). body of page ~10k , sample got me 1120ms 2 rows (<20k). feels wrong takes long. should able both pages on network in less time.

what can speed things up? have index, i'm not sure else can do.

using like prevent use of index.

compare

sqlite> explain query plan select * pageinfo url = @url or url @url2; 0|0|0|scan table pageinfo (~500000 rows) sqlite>  

to

sqlite> explain query plan select * pageinfo url = @url or url between @url2 , @url3; 0|0|0|search table pageinfo using index pi (url=?) (~10 rows) 0|0|0|search table pageinfo using index pi (url>? , url<?) (~31250 rows) sqlite>  

you should use between , construct arguments query @url2 , @url3 such

/sub2/1234/thing?page=0 

and

/sub2/1234/thing?page=99999999 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -