Re: [HACKERS] Solution for LIMIT cost estimation
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Don Baccus <dhogaza@pacifier.com>
Cc: Chris <chris@bitmead.com>, pgsql-hackers@postgresql.org
Date: 2000-02-13T23:43:31Z
Lists: pgsql-hackers
Don Baccus <dhogaza@pacifier.com> writes: >> The optimizer's job would be far simpler if no-brainer rules like >> "indexscan is always better" worked. > Yet the optimizer currently takes the no-brainer point-of-view that > "indexscan is slow for tables much larger than the disk cache, therefore > treat all tables as though they're much larger than the disk cache". Ah, you haven't seen the (as-yet-uncommitted) optimizer changes I'm working on ;-) What I still lack is a believable approximation curve for cache hit ratio vs. table-size-divided-by-cache-size. Anybody seen any papers about that? I made up a plausible-shaped function but it'd be nice to have something with some actual theory or measurement behind it... (Of course the cache size is only a magic number in the absence of any hard info about what the kernel is doing --- but at least it will optimize big tables differently than small ones now.) regards, tom lane