Good afternoon,
I am doing a thesis from the University. My thesis is the modification of the Gurjeet Index Adviser, to add some features.
At the moment I am modifying one of the .c files and adding a function called get_columnames that returns the names of the columns of a table, passing it the numbers of the attributes.
I really thought a lot, but I don't understand why but the function fails after the _expression_ is executed:
appendStringInfo (& cols, "% s a.attnum =% d", (i> 0? "OR": ""), idxcd-> varattno [i]);
The error appears only to me when entering the cycle:
foreach (cell, candidates) / * foreach cell in candidates * /
more than once, that is, when you have more than one candidate index. If the cycle is entered only once, the function works correctly.
The error that appears to me is that the connection to the PostgreSQL server is directly lost. I proved that the error occurs in that statement, printing some values.
The error that appears to me is the following:
The connection to the server was lost. Attempting reset: Failed.
I attach the source code of the function (function.c) and the log file with the output of the last executions.
I clarify that the foreach cycle for the c language is defined in #include "nodes / pg_list.h"
I am using Postgresql 8.3.23.
I clarify that I use that version because it is compatible with the Index Adviser, which I am modifying for my University thesis.
I was analyzing and researching on the compilation without optimizations, with symbols and also on the use of gbd. Very interesting everything.
My query is now if all this can be applied the same if a Makefile is used. Because the Index Adviser comes with a Makefile that runs for compilation. That is, as I read it is more or less easy to apply all this if I'm going to compile from the command line but having the Makefile, the truth is that I don't know how to apply it. I am new with Linux.
The Linux distribution I use is Debian 9.x 64-bit.
And the version of C (gcc) that I use is 6.3.0
I will greatly appreciate an answer please,
I also attach the Index Adviser Makefile.
I would greatly appreciate a help please. I really am not knowing how to move forward.
As I commented, my function works for the case in which the foreach is entered only once. But when you enter more than once, it doesn't work. That is, when you have more than one candidate index, it gives me that error.
This means that, for example, for a simple Select type statement or that has an AND it works for me. But for the case where the Select statement has an OR for example, it doesn't work. Because you already have more than one candidate index and enter the foreach more than once.
I will be very grateful if anyone can help me please.
I already thought a lot why the mistake could happen but I can't really find a reason.
Best regards,
I am doing a thesis from the University. My thesis is the modification of the Gurjeet Index Adviser, to add some features.
At the moment I am modifying one of the .c files and adding a function called get_columnames that returns the names of the columns of a table, passing it the numbers of the attributes.
I really thought a lot, but I don't understand why but the function fails after the _expression_ is executed:
appendStringInfo (& cols, "% s a.attnum =% d", (i> 0? "OR": ""), idxcd-> varattno [i]);
The error appears only to me when entering the cycle:
foreach (cell, candidates) / * foreach cell in candidates * /
more than once, that is, when you have more than one candidate index. If the cycle is entered only once, the function works correctly.
The error that appears to me is that the connection to the PostgreSQL server is directly lost. I proved that the error occurs in that statement, printing some values.
The error that appears to me is the following:
The connection to the server was lost. Attempting reset: Failed.
I attach the source code of the function (function.c) and the log file with the output of the last executions.
I clarify that the foreach cycle for the c language is defined in #include "nodes / pg_list.h"
I am using Postgresql 8.3.23.
I clarify that I use that version because it is compatible with the Index Adviser, which I am modifying for my University thesis.
I was analyzing and researching on the compilation without optimizations, with symbols and also on the use of gbd. Very interesting everything.
My query is now if all this can be applied the same if a Makefile is used. Because the Index Adviser comes with a Makefile that runs for compilation. That is, as I read it is more or less easy to apply all this if I'm going to compile from the command line but having the Makefile, the truth is that I don't know how to apply it. I am new with Linux.
The Linux distribution I use is Debian 9.x 64-bit.
And the version of C (gcc) that I use is 6.3.0
I will greatly appreciate an answer please,
I also attach the Index Adviser Makefile.
I would greatly appreciate a help please. I really am not knowing how to move forward.
As I commented, my function works for the case in which the foreach is entered only once. But when you enter more than once, it doesn't work. That is, when you have more than one candidate index, it gives me that error.
This means that, for example, for a simple Select type statement or that has an AND it works for me. But for the case where the Select statement has an OR for example, it doesn't work. Because you already have more than one candidate index and enter the foreach more than once.
I will be very grateful if anyone can help me please.
I already thought a lot why the mistake could happen but I can't really find a reason.
Best regards,
Yessica Brinkmann
FATAL: the database system is in recovery mode LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: database system was shut down at 2019-10-04 00:58:21 CEST LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: server process (PID 1245) was terminated by signal 11: Segmentation fault LOG: terminating any other active server processes LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2019-10-04 02:08:57 CEST LOG: database system was not properly shut down; automatic recovery in progress FATAL: the database system is in recovery mode LOG: redo starts at 0/BEE6A00 LOG: record with zero length at 0/BEFA848 LOG: redo done at 0/BEFA818 LOG: last completed transaction was at log time 2019-10-04 02:11:33.931119+02 LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: server process (PID 1388) was terminated by signal 11: Segmentation fault LOG: terminating any other active server processes LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2019-10-04 02:11:44 CEST LOG: database system was not properly shut down; automatic recovery in progress LOG: redo starts at 0/BEFA890 LOG: record with zero length at 0/BF0F940 LOG: redo done at 0/BF0F910 LOG: last completed transaction was at log time 2019-10-04 02:17:13.560035+02 FATAL: the database system is in recovery mode LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: received smart shutdown request LOG: received SIGHUP, reloading configuration files LOG: autovacuum launcher shutting down LOG: shutting down LOG: database system is shut down LOG: database system was shut down at 2019-10-04 02:36:09 CEST LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: server process (PID 1271) was terminated by signal 11: Segmentation fault LOG: terminating any other active server processes LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2019-10-04 15:44:07 CEST LOG: database system was not properly shut down; automatic recovery in progress FATAL: the database system is in recovery mode LOG: redo starts at 0/BF0F9D0 LOG: unexpected pageaddr 0/5F14000 in log file 0, segment 11, offset 15810560 LOG: redo done at 0/BF13140 LOG: last completed transaction was at log time 2019-10-04 15:46:27.151167+02 LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: server process (PID 1565) was terminated by signal 11: Segmentation fault LOG: terminating any other active server processes LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2019-10-04 15:46:53 CEST LOG: database system was not properly shut down; automatic recovery in progress FATAL: the database system is in recovery mode LOG: redo starts at 0/BF13998 LOG: record with zero length at 0/BF2A1C0 LOG: redo done at 0/BF2A190 LOG: last completed transaction was at log time 2019-10-04 16:05:58.835759+02 LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: server process (PID 1847) was terminated by signal 11: Segmentation fault LOG: terminating any other active server processes LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2019-10-04 16:06:07 CEST LOG: database system was not properly shut down; automatic recovery in progress FATAL: the database system is in recovery mode LOG: redo starts at 0/BF2A208 LOG: record with zero length at 0/BF3FAD0 LOG: redo done at 0/BF3FAA0 LOG: last completed transaction was at log time 2019-10-04 16:24:48.038614+02 LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: received smart shutdown request LOG: received SIGHUP, reloading configuration files LOG: autovacuum launcher shutting down LOG: shutting down LOG: database system is shut down LOG: database system was shut down at 2019-10-04 16:29:42 CEST LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: received smart shutdown request LOG: received SIGHUP, reloading configuration files LOG: autovacuum launcher shutting down LOG: shutting down LOG: database system is shut down
Attachment:
función.c
Description: Binary data
# # PostgreSQL Adviser top level makefile # PGFILEDESC = "PostgreSQL Index Advisor" ifdef USE_PGXS PGXS := $(shell pg_config --pgxs) include $(PGXS) else subdir = contrib/adviser top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif all: $(MAKE) -C index_adviser $@ $(MAKE) -C pg_advise $@ $(MAKE) -C resources $@ @echo "PostgreSQL Index Advisor successfully made. Ready to install." install: $(MAKE) -C index_adviser $@ $(MAKE) -C pg_advise $@ $(MAKE) -C resources $@ @echo "PostgreSQL Index Advisor installed." uninstall: $(MAKE) -C index_adviser $@ $(MAKE) -C pg_advise $@ $(MAKE) -C resources $@ @echo "PostgreSQL Index Advisor uninstalled." clean: $(MAKE) -C index_adviser $@ $(MAKE) -C pg_advise $@ $(MAKE) -C resources $@