Hi! If query is covered by index, is not more fast to do a "index scan"?
I know that MS SQL Server does some nice optimizations using "indexes that cover queries" (all fields that make part of the query exists on the index). This is a true (in MS SQL case) because indexes pages, that will have less fields that table (not case in example from Jason) will have less pages to read from disks, improving IO performance. And excuse-me if SapDB already does this: I really don't know too much about internals from SapDB (besides I already downloaded sources to do some reading...). Exists any PDFs that explains, in details, strategies for performance optimizations and how SapDB does his choices? Thanks & m2c, Edson Richter ----- Original Message ----- From: "Becker, Holger" <[EMAIL PROTECTED]> To: "'Jason Louder'" <[EMAIL PROTECTED]>; "Schildberg, Steffen" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 07, 2003 8:19 AM Subject: RE: index > Jason Louder wrote: > > > I need some help with indexes. I've created a table and index. > > > > create table test( > > id serial, > > name varchar(20), > > primary key(id) > > ) > > > > create index indexName on test(name) > > update statistics test > > > > and when I tried explain select name from test where name = 'blah'. > > it gave me 'table scan', while I'm expecting an index lookup. > > What could be the cause ? > > > > And also I'm using 7.4, what database parameters are important for optimization ? > > > SAP DB used a costbased optimizer. > So the optimizer seems to calculate less costs for > the tablescan than for the index access in your case. > This could be true if there is no or only few data in table test. > Or 'blah' is a very frequently used name in test. > "select * from optimizerstatistics where tablename = 'TEST'" > should show you wich reason is true for you. > > Kind regards, > Holger > SAP Labs Berlin > _______________________________________________ > sapdb.general mailing list > [EMAIL PROTECTED] > http://listserv.sap.com/mailman/listinfo/sapdb.general > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 27/1/2003 _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
