3

I've been using Slick's insertOrUpdate since its release in 2.1 version without any issue.

Right now I'm trying to improve my code performance and insertOrUpdate is the bottleneck (according to jProfiler). I thought I could improve this by using a compiled query but as far as I can see, invoking insertOrUpdate I have a SingleInsertOrUpdateResult and not a Query object.

Is there a way to get a compiled query for insertOrUpdate? Or is there another way to improve it's performance?

Thanks in advance

Community
  • 1
  • 1
magicknot
  • 51
  • 4

1 Answers1

1

It's the same as for the the other insert operations like +=: You have to compile the Query and then call insertOrUpdate on the resulting CompiledQuery.

szeiger
  • 1,406
  • 9
  • 11
  • But in my case I don't have any intermediate query, all I do is calling `insertOrUpdate` on my `TableQuery`. – magicknot Feb 06 '15 at 02:13