diff --git a/gradle.properties b/gradle.properties index 9d84e22f7d..974eee12b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ mavenPassword=YourPassword # here-naksha-lib-psql/src/commonMain/kotlin/naksha/psql/LibPsql.kt (adminVersion property) # Warning: Only update LibPsql version, if there is a change in SQL functions! # The reason is, that this version is encoded in the database, and when updated, forced an upgrade! -version=3.0.0-beta.36 +version=3.0.0-beta.37 org.gradle.jvmargs=-Xmx12g kotlin.code.style=official diff --git a/here-naksha-app-service/src/jvmMain/resources/swagger/openapi.yaml b/here-naksha-app-service/src/jvmMain/resources/swagger/openapi.yaml index 0d5ee57b35..4d53de0d33 100644 --- a/here-naksha-app-service/src/jvmMain/resources/swagger/openapi.yaml +++ b/here-naksha-app-service/src/jvmMain/resources/swagger/openapi.yaml @@ -12,7 +12,7 @@ servers: info: title: "Naskha Hub-API" description: "Naksha Hub-API is a REST API to provide simple access to geo data." - version: "3.0.0-beta.36" + version: "3.0.0-beta.37" security: - AccessToken: [ ] diff --git a/here-naksha-lib-model/src/commonMain/kotlin/naksha/model/NakshaVersion.kt b/here-naksha-lib-model/src/commonMain/kotlin/naksha/model/NakshaVersion.kt index a6077efb24..bd80926975 100644 --- a/here-naksha-lib-model/src/commonMain/kotlin/naksha/model/NakshaVersion.kt +++ b/here-naksha-lib-model/src/commonMain/kotlin/naksha/model/NakshaVersion.kt @@ -89,7 +89,7 @@ class NakshaVersion( * The current version as string to constant usage cases. * @since 3.0 */ - const val CURRENT = "3.0.0-beta.36" + const val CURRENT = "3.0.0-beta.37" // WARNING: Do not update this property manually, it is automatically modified when building! // Edit version only in `gradle.properties` file, which is used as well to create artifacts! diff --git a/here-naksha-lib-psql/src/commonMain/kotlin/naksha/psql/PgQueryWhereBuilder.kt b/here-naksha-lib-psql/src/commonMain/kotlin/naksha/psql/PgQueryWhereBuilder.kt index 59e77d63ff..e20112b051 100644 --- a/here-naksha-lib-psql/src/commonMain/kotlin/naksha/psql/PgQueryWhereBuilder.kt +++ b/here-naksha-lib-psql/src/commonMain/kotlin/naksha/psql/PgQueryWhereBuilder.kt @@ -334,9 +334,10 @@ internal class PgQueryWhereBuilder(private val request: ReadFeatures) { if(containsOnlyTagExists(tagQuery)){ // for tags without values we can utilize top-level-key based '?|' operand // https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE + val tagNames = tagQuery.filterIsInstance().map { it.name } resolveTagNamesArrayOperation( - jsonbOperator = "jsonb_exists_any", // equivalent of '?|' - tagNames = (tagQuery as ListProxy).mapNotNull { it?.name } + jsonbOperator = "?|", // 'jsonb_exists_any' is equivalent but will not hit the GIN index + tagNames = tagNames ) } else { or(tagQuery.filterNotNull(), this::whereNestedTags) @@ -346,9 +347,10 @@ internal class PgQueryWhereBuilder(private val request: ReadFeatures) { if(containsOnlyTagExists(tagQuery)){ // for tags without values we can utilize top-level-key based '?&' operand // https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE + val tagNames = tagQuery.filterIsInstance().map { it.name } resolveTagNamesArrayOperation( - jsonbOperator = "jsonb_exists_all", // equivalent of '?&' - tagNames = (tagQuery as ListProxy).mapNotNull { it?.name } + jsonbOperator = "?&", // 'jsonb_exists_all' is equivalent but MIGHT not hit the GIN index + tagNames = tagNames ) } else { and(tagQuery.filterNotNull(), this::whereNestedTags) @@ -359,12 +361,12 @@ internal class PgQueryWhereBuilder(private val request: ReadFeatures) { } private fun containsOnlyTagExists(container: ListProxy): Boolean = - container.all { it is TagExists } + container.all { it == null || it is TagExists } private fun resolveTagNamesArrayOperation(jsonbOperator: String, tagNames: List) { val tagKeysArray = tagNames.toTypedArray() val tagKeysPlaceholder = placeholderForArg(tagKeysArray, PgType.STRING_ARRAY) - where.append("$jsonbOperator($tagsAsJsonb, $tagKeysPlaceholder)") + where.append("$tagsAsJsonb ?$jsonbOperator $tagKeysPlaceholder") } private fun resolveSingleTagQuery(tagQuery: TagQuery) {