60 clock_t start_t = clock();
62 const int tuple_limit = 1000000;
64 size_t total_tuples = 0;
69 for (i = 0; i < 3; ++i) {
75 info[0].
name =
"start_vid";
76 info[1].
name =
"end_vid";
77 info[2].
name =
"agg_cost";
90 (*total_rows) = total_tuples;
92 while (moredata ==
true) {
93 SPI_cursor_fetch(SPIportal,
true, tuple_limit);
94 if (total_tuples == 0)
97 size_t ntuples = SPI_processed;
98 total_tuples += ntuples;
108 if ((*rows) == NULL) {
109 elog(ERROR,
"Out of memory");
112 SPITupleTable *tuptable = SPI_tuptable;
113 TupleDesc tupdesc = SPI_tuptable->tupdesc;
114 PGR_DBG(
"processing %ld matrix cell tupĺes", ntuples);
117 for (t = 0; t < ntuples; t++) {
118 HeapTuple tuple = tuptable->vals[t];
120 &(*rows)[total_tuples - ntuples + t]);
122 SPI_freetuptable(tuptable);
128 SPI_cursor_close(SPIportal);
131 if (total_tuples == 0) {
137 (*total_rows) = total_tuples;
138 time_msg(
" reading matrix cells", start_t, clock());