Forum OpenACS Development: Re: Compatibility Matrix
What you describe can be used to filter ouput to the client of the scan, but no, table data's not sorted so seq scans do scan the whole table.
Absent partitioning, I guess, which is useful for data warehousing, not dynamic websites.
Good to know. Thank you.
It seems to me that smart (whatever it's called) interpolation of an ordered set could be faster than sequencing once the count reaches some massive number.. By "smart" I'm referring to a modified conventional mathematical interpolation, where the next best guess uses the last two data points to suggest an intersecting line and intersection point to jump to --providing the next best guess.
Assuming 69 million rows, ordered, non-linear values, one could probably cut to search range with a very small count within just a few steps.. Would be fun to play with.
Anyway, I've successfully used a technique like this to reduce the interpolation loops of some business math functions to something reasonable for dynamic web pages.. About 12 iterations on projects with millions of values, non-linear. I'd be glad to share, if you know someone that want to pursue this.
But there's no order imposed on the rows in the db. Unless you insert them in a certain order and never delete or update even one single row in the table.
I suppose there are tables like that but it's certainly not typical of how a database is used.