Subject Re: [firebird-support] Query not using/choosing plan correctly
Author Martijn Tonies
Hi,

>> CREATE TABLE ORDERSM (
>> OM_ID integer NOT NULL,
>> OM_CUS_ID VARCHAR(6) CHARACTER SET NONE COLLATE NONE,
>> OM_INVNUM integer,
>> OM_COMPANY varchar(30));
>>
>> ALTER TABLE ORDERSM ADD CONSTRAINT ORDERSMBYID PRIMARY KEY (OM_ID);
>>
>> CREATE UNIQUE DESC INDEX ORDERSMBYCUSTNUM3 ON ORDERSM(OM_CUS_ID,OM_ID);
>>


> Wow, that does make a huge difference. That is as fast as I had expected
> it would be..
>
> However, why doesn't it work with INTEGERS. It would seem to me that
> an index built on integer fields would work faster than one based on a
> strings?

You're creating the index on a string field, not an integer field.

> Could you please enlighten me. I really don't understand this
> deterministic
> way
> of converting a number???????


With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com