Int property vs string property in performance

(Michael Weston) #1


I would like to know if there is a difference between int property or a string property in the following scenario:

I have multiple relations and every one of them have an "index" property.
Until now i have had strings of int in the property - "1", "12", "63".

Here is my question - Is there a difference between my current scenario to a scenario that the property is of type int?
If there is a difference, what is it?

thank you very much :slight_smile:


(DKumar) #2

Hi @o9384496,

You will have data type mismatch when querying an int when it's actually a string.

When you are searching for the string as an "int" you should use Scalar functions like toInteger() for queries. -->

to check the datatype of the property use type(property). -->


(Michael Weston) #3

Yes I know.
My question was what is the best way, to use an int or a string.
Of course my queries will use the data type that is in the db