On 14 Jun 2018, at 7:31pm, x <tam118...@hotmail.com> wrote:

> Why is using ‘RowID desc’ so much slower than ‘RowID asc’ after a ‘reboot’? I 
> get the impression Windows is caching the pages from the ‘desc’ but not the 
> ‘asc’ and that’s what’s slowing it down. On this particular journey I’ve come 
> across tables where the reverse was the case (I.e. it was the ‘asc’ that was 
> woefully slow).

Windows storage devices traditionally use read-ahead strategy.  This means that 
if you ask to read sector n they will sometimes read sector n+1 into cache at 
the same time on the assumption that you will need that next.  This strategy 
backfires bigtime when applied to solid state drives because unlike spinning 
rust disks, reading two sectors takes almost twice as long.

Your computer should know this, and shouldn't be trying to apply a read-ahead 
strategy but something may have gone wrong.

> Anyone cast any light on this?

Now do exactly the same test, but have the file stored on a USB Flash drive 
instead of the boot volume.  You should be able to do something like

.open d:\MyTemp.db

See how this influences any change.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to