You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by "Meeks, Andrew" <an...@vt.edu> on 2021/11/23 15:16:57 UTC

Performance with quoteSqlIdentifiers

Hello,

My production database is Oracle but I do local testing with in-memory H2.  I have been using two datamaps; "src/main/resources/datamap.map.xml", and "src/test/resources/datamap.map.xml".  When I make an ORM change and it's been a year or two, I eventually remember to copy the datamap from main to test but I almost always forget that the test datamap has "<property name="quoteSqlIdentifiers" value="true"/>" because H2 has a different set of reserved words than Oracle.

I have two questions:

  1.  Is there much of a performance issue in leaving quoteSqlIdentifiers set to "true" even when it's not necessary in production?
  2.  Is there a way the test datamap can reference and extend the main datamap?  By that I mean, can the test datamap simply pull in the main datamap and augment it with the quoteSqlIdentifiers property?  The cayenne.xml is very different between production and test and the cayenne configuration appears to expect the file with the prefix specified in "<map name="datamap"/>" is located in the same directory. That seems to necessitate keeping separate copies of the nearly-identical datamap.map.xml.

Thank you,
Andrew

RE: Performance with quoteSqlIdentifiers

Posted by "Meeks, Andrew" <an...@vt.edu>.
That's great to know!  Thank you for the quick response.

-----Original Message-----
From: Andrus Adamchik <aa...@gmail.com> 
Sent: Tuesday, November 23, 2021 10:24 AM
To: user@cayenne.apache.org
Subject: Re: Performance with quoteSqlIdentifiers

Hi Andrew,

DataMaps don't work as "layers" on top of each other, so the answer to #2 is no. For #1, I am not aware of any visible performance impact of quoting identifiers. So you can just use quoted identifiers everywhere.

Andrus


> On Nov 23, 2021, at 5:16 PM, Meeks, Andrew <an...@vt.edu> wrote:
> 
> Hello,
> 
> My production database is Oracle but I do local testing with in-memory H2.  I have been using two datamaps; "src/main/resources/datamap.map.xml", and "src/test/resources/datamap.map.xml".  When I make an ORM change and it's been a year or two, I eventually remember to copy the datamap from main to test but I almost always forget that the test datamap has "<property name="quoteSqlIdentifiers" value="true"/>" because H2 has a different set of reserved words than Oracle.
> 
> I have two questions:
> 
>  1.  Is there much of a performance issue in leaving quoteSqlIdentifiers set to "true" even when it's not necessary in production?
>  2.  Is there a way the test datamap can reference and extend the main datamap?  By that I mean, can the test datamap simply pull in the main datamap and augment it with the quoteSqlIdentifiers property?  The cayenne.xml is very different between production and test and the cayenne configuration appears to expect the file with the prefix specified in "<map name="datamap"/>" is located in the same directory. That seems to necessitate keeping separate copies of the nearly-identical datamap.map.xml.
> 
> Thank you,
> Andrew


Re: Performance with quoteSqlIdentifiers

Posted by Andrus Adamchik <aa...@gmail.com>.
Hi Andrew,

DataMaps don't work as "layers" on top of each other, so the answer to #2 is no. For #1, I am not aware of any visible performance impact of quoting identifiers. So you can just use quoted identifiers everywhere.

Andrus


> On Nov 23, 2021, at 5:16 PM, Meeks, Andrew <an...@vt.edu> wrote:
> 
> Hello,
> 
> My production database is Oracle but I do local testing with in-memory H2.  I have been using two datamaps; "src/main/resources/datamap.map.xml", and "src/test/resources/datamap.map.xml".  When I make an ORM change and it's been a year or two, I eventually remember to copy the datamap from main to test but I almost always forget that the test datamap has "<property name="quoteSqlIdentifiers" value="true"/>" because H2 has a different set of reserved words than Oracle.
> 
> I have two questions:
> 
>  1.  Is there much of a performance issue in leaving quoteSqlIdentifiers set to "true" even when it's not necessary in production?
>  2.  Is there a way the test datamap can reference and extend the main datamap?  By that I mean, can the test datamap simply pull in the main datamap and augment it with the quoteSqlIdentifiers property?  The cayenne.xml is very different between production and test and the cayenne configuration appears to expect the file with the prefix specified in "<map name="datamap"/>" is located in the same directory. That seems to necessitate keeping separate copies of the nearly-identical datamap.map.xml.
> 
> Thank you,
> Andrew