On Fri, Mar 03, 2006 at 04:14:41PM +0100, Csaba Nagy wrote: > > Ewe. How expensive is scanning an index compared to the heap? Does > > anyone have figure on that in terms of I/O and time? > > See this post for an example: > http://archives.postgresql.org/pgsql-performance/2006-02/msg00416.php > > For my 200 million table, scanning the pk index took ~ 4 hours. And then > there are some more indexes... > > So if the index has to be scanned completely, that's still too much.
But how does a scan of the index compare to a scan of the table? For example, if indexes are 1/5th the size of the table, you can (theoretically) scan 5 indexes in the same amount of time it takes to scan the heap. That indicates to me that even if we did have to scan all indexes, a dirty page bitmap would still be a win over the current situation. But it appears that it should be safe to do index lookups on indexes that aren't expressions. And I believe that we could take steps down the road to allow for index lookups on indexes that only used functions that were known to be safe. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match