Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Ann Harrison


 On Jul 1, 2015, at 9:34 AM, Dmitry Yemanov firebi...@yandex.ru wrote:
 
 01.07.2015 13:49, Vlad Khorsun wrote:
 
 Not sure what you mean by same? Let's say I change it from smallint to int.
 
 All kind of numbers have the same representation in index keys.
 
 Except BIGINT, IIRC.
 

Which was a mistake on Borland's part.  InterBase originally had an eight byte 
integer (called a quad) that supported the VAX datatype.  Indexes on quad used 
the same representation as other numeric types - a mutilated double precision.  
Since InterBase  Firebird always retrieve a range of values to make up for the 
imprecise conversion from decimal fractions to binary fractions, the loss of 
precision doesn't matter.  If the Borland engineers had really thought about 
it, they could have added a few extra bits at the end of the key to handle the 
exact precision, but instead they decided to add a new index key type.   

On some ODS change it might make sense to go back to a single format for all 
numeric indexes to make enlarging numbers easier.


Cheers,

Ann




--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Dmitry Yemanov
01.07.2015 13:49, Vlad Khorsun wrote:

 Not sure what you mean by same? Let's say I change it from smallint to int.

 All kind of numbers have the same representation in index keys.

Except BIGINT, IIRC.


Dmitry


--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Vlad Khorsun
01.07.2015 16:34, Dmitry Yemanov wrote:
 01.07.2015 13:49, Vlad Khorsun wrote:

 Not sure what you mean by same? Let's say I change it from smallint to int.

 All kind of numbers have the same representation in index keys.

 Except BIGINT, IIRC.

   Correct.

Regards,
Vlad


PS One can find correspondence between SQL data types and BTR data types
at DFW_assign_index_type()


--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Vlad Khorsun
01.07.2015 12:14, Jiří Činčura wrote:
 Hi *,

 Firebird allows me to change domain's datatype even if column with this 
 domain is used in an index.
  Is it OK or should the index be dropped and created again?

   If new datatype is the same from index POV, there is no need to rebuild 
index.
Else, IIRC, engine rebuild all indices dependent on domain-based fields.
You can check it yourself, btw :)

Regards,
Vlad

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Jiří Činčura
Look at execution statistics. If commit took more time than expected
 (few ms), performs a lot of fetches\marks, etc - it could be sign that
 index(es) was rebuild.

Thanks. I'm testing now on empty database, just to see what's possible. I'll 
generate some data.


-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Vlad Khorsun
01.07.2015 13:34, Jiří Činčura wrote:
 If new datatype is the same from index POV, there is no need to rebuild
 index.

 Not sure what you mean by same? Let's say I change it from smallint to int.

   All kind of numbers have the same representation in index keys. So, in the
case above there is no need to rebuild index.

 Else, IIRC, engine rebuild all indices dependent on domain-based fields.
 You can check it yourself, btw :)

 How?

   Look at execution statistics. If commit took more time than expected (few 
ms),
performs a lot of fetches\marks, etc - it could be sign that index(es) was 
rebuild.

Regards,
Vlad


--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping index on domain change?

2015-07-01 Thread Jiří Činčura
If new datatype is the same from index POV, there is no need to rebuild
 index.

Not sure what you mean by same? Let's say I change it from smallint to int.

 Else, IIRC, engine rebuild all indices dependent on domain-based fields.
 You can check it yourself, btw :)

How? 

-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel