75 (errmsg(
"Column \'%s\' not Found", info[8].name),
76 errhint(
"%s was found, also column is expected %s ",
77 info[9].name, info[8].name)));
82 (errmsg(
"Column \'%s\' not Found", info[9].name),
83 errhint(
"%s was found, also column is expected %s ",
84 info[8].name, info[9].name)));
97 (errmsg(
"Column \'%s\' not Found", info[10].name),
98 errhint(
"%s was found, also column is expected %s ",
99 info[10].name, info[11].name)));
105 (errmsg(
"Column \'%s\' not Found", info[11].name),
106 errhint(
"%s was found, also column is expected %s ",
107 info[11].name, info[10].name)));
138 size_t *total_vehicles,
140 clock_t start_t = clock();
142 const int tuple_limit = 1000000;
150 for (i = 0; i < 16; ++i) {
158 info[1].
name =
"capacity";
159 info[2].
name =
"start_x";
160 info[3].
name =
"start_y";
161 info[4].
name =
"number";
162 info[5].
name =
"start_open";
163 info[6].
name =
"start_close";
164 info[7].
name =
"start_service";
165 info[8].
name =
"end_x";
166 info[9].
name =
"end_y";
167 info[10].
name =
"end_open";
168 info[11].
name =
"end_close";
169 info[12].
name =
"end_service";
170 info[13].
name =
"speed";
171 info[14].
name =
"start_node_id";
172 info[15].
name =
"end_node_id";
179 for (i = 4; i < 16; ++i) {
200 bool moredata =
true;
201 (*total_vehicles) = total_tuples = 0;
205 while (moredata ==
true) {
206 SPI_cursor_fetch(SPIportal,
true, tuple_limit);
207 if (total_tuples == 0) {
210 size_t ntuples = SPI_processed;
211 total_tuples += ntuples;
212 PGR_DBG(
"SPI_processed %ld", ntuples);
214 if ((*vehicles) == NULL)
222 if ((*vehicles) == NULL) {
223 elog(ERROR,
"Out of memory");
227 SPITupleTable *tuptable = SPI_tuptable;
228 TupleDesc tupdesc = SPI_tuptable->tupdesc;
229 PGR_DBG(
"processing %ld", ntuples);
230 for (t = 0; t < ntuples; t++) {
231 HeapTuple tuple = tuptable->vals[t];
233 &(*vehicles)[total_tuples - ntuples + t], with_id);
235 SPI_freetuptable(tuptable);
241 SPI_cursor_close(SPIportal);
243 if (total_tuples == 0) {
244 (*total_vehicles) = 0;
249 (*total_vehicles) = total_tuples;
251 PGR_DBG(
"Finish reading %ld vehicles for matrix", (*total_vehicles));
253 PGR_DBG(
"Finish reading %ld vehicles for euclidean", (*total_vehicles));
255 time_msg(
"reading edges", start_t, clock());
262 size_t *total_vehicles) {
270 size_t *total_vehicles) {