>But these special optimizations only apply when min(), max(), and count(*) are used in isolation. Hence, they do not work for the first query above that uses all three functions at one.
Thanks Richard. >(1) If you are using INTEGER PRIMARY KEY, you should *not* be using a WITHOUT ROWID. You can. It will get the correct answer. But it will be unnecessarily slower. I created that table when i first started learning SQLite because I thought it would take up less space. I later read what you mention in (1) above and went back and rebuilt the table minus the WITHOUT ROWID. It then took up more space and there was no noticeable speed gain so I reverted back. As I said, it was a while ago but I’ll revisit the whole affair when I’ve more time. >(2) You should never include a single-column PRIMARY KEY as part of an index. The database engine will do that for you automatically. That’s something else I only realised recently. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users