You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Mashenkov (Jira)" <ji...@apache.org> on 2023/02/22 09:12:00 UTC

[jira] [Created] (IGNITE-18872) Sql. Make IgniteTypeFactory a singletone.

Andrey Mashenkov created IGNITE-18872:
-----------------------------------------

             Summary: Sql. Make IgniteTypeFactory a singletone.
                 Key: IGNITE-18872
                 URL: https://issues.apache.org/jira/browse/IGNITE-18872
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Andrey Mashenkov
             Fix For: 3.0.0-beta2


As of now we have one static instance of TypeFactory in BasicQueryContext and another one is creating in the class constructor.
TypeFactory cache type objects and use intern (similar to String.intern()) to avoid duplicate objects.
Type comparison, which are created with different factories, via equals is not cheap. Actually, a string digest of each object created, then strings are compared each time.
It make no sense to have more than one TypeFactory instance. 
 
Also, we have few places where types are compared as ‘==’ that is incorrect.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)