if (PQstatus(conn) != CONNECTION_OK) {
fprintf(stderr, "Connection to database failed: %s\n", PQerrorMessage(conn));
exit(EXIT_FAILURE);
if (PQstatus(conn) != CONNECTION_OK) {
fprintf(stderr, "Connection to database failed: %s\n", PQerrorMessage(conn));
exit(EXIT_FAILURE);
pg_prepare_params[0] = PG_OID_INT4;
res = PQprepare(conn, "index_sectors",
pg_prepare_params[0] = PG_OID_INT4;
res = PQprepare(conn, "index_sectors",
- "select geometry_sector,count(*) from placex where rank_search = $1 and indexed = false and name is not null group by geometry_sector order by geometry_sector",
+ "select geometry_sector,count(*) from placex where rank_search = $1 and indexed_status > 0 group by geometry_sector order by geometry_sector",
PQclear(res);
pg_prepare_params[0] = PG_OID_INT4;
pg_prepare_params[1] = PG_OID_INT4;
res = PQprepare(conn, "index_sector_places",
PQclear(res);
pg_prepare_params[0] = PG_OID_INT4;
pg_prepare_params[1] = PG_OID_INT4;
res = PQprepare(conn, "index_sector_places",
- "select place_id from placex where rank_search = $1 and geometry_index(geometry,indexed,name) = $2",
+ "select place_id from placex where rank_search = $1 and geometry_sector = $2 and indexed_status > 0",
(*thread_data->count)++;
pthread_mutex_unlock( thread_data->count_mutex );
//printf(" Processing place_id %ld\n", place_id);
(*thread_data->count)++;
pthread_mutex_unlock( thread_data->count_mutex );
//printf(" Processing place_id %ld\n", place_id);