A device for compiling an INDEX to create a shared object file for making data available from a database, responsive to one or more query comprising at least one command to compile the INDEX, said device comprising: an input/output hardware for receiving the query for querying the database; a processor configured to specify the query, wherein the query comprises a "CREATE INDEX" statement with a command to create the shared object file by compiling the INDEX; a memory coupled with said processor, wherein in presence of said command to compile, said memory provides said processor with instructions to: natively compile the query, in response to the command, to generate a C-file corresponding to each INDEX in the query, and thereby generate the shared object file by compiling the C-file generated, the shared object file comprising at least one structure and at least one mechanism to perform at least one operation on an INDEX based on an indexed column in the database and load the shared object file along with at least one executable file in the device for an execution of the query; wherein the device is configured to: create, based on the query received, a structure corresponding to said index; generate, based on the query received, at least one access function for an index tuple value, and at least one instruction to find an appropriate slot for an index tuple; store the structures created, the access function generated, and the access function generated in a buffer, and create the C-file based on stored structure, access function and instructions; compile the C-file created using at least one pre-stored compiler; thereby generate the shared object file from said C-file, wherein the shared object file is a dynamic link library file; wherein the shared object file comprises at least one of list of columns in the INDEX, one or more access function for an index tuple value, one or more instructions to find an appropriate slot for an index tuple, and any combination thereof. an input/output hardware for receiving the query for querying the database; a processor configured to specify the query, wherein the query comprises a "CREATE INDEX" statement with a command to create the shared object file by compiling the INDEX; a memory coupled with said processor, wherein in presence of said command to compile, said memory provides said processor with instructions to: natively compile the query, in response to the command, to generate a C-file corresponding to each INDEX in the query, and thereby generate the shared object file by compiling the C-file generated, the shared object file comprising at least one structure and at least one mechanism to perform at least one operation on an INDEX based on an indexed column in the database and load the shared object file along with at least one executable file in the device for an execution of the query; wherein the device is configured to: create, based on the query received, a structure corresponding to said index; generate, based on the query received, at least one access function for an index tuple value, and at least one instruction to find an appropriate slot for an index tuple; store the structures created, the access function generated, and the access function generated in a buffer, and create the C-file based on stored structure, access function and instructions; compile the C-file created using at least one pre-stored compiler; thereby generate the shared object file from said C-file, wherein the shared object file is a dynamic link library file; natively compile the query, in response to the command, to generate a C-file corresponding to each INDEX in the query, and thereby generate the shared object file by compiling the C-file generated, the shared object file comprising at least one structure and at least one mechanism to perform at least one operation on an INDEX based on an indexed column in the database and load the shared object file along with at least one executable file in the device for an execution of the query; create, based on the query received, a structure corresponding to said index; generate, based on the query received, at least one access function for an index tuple value, and at least one instruction to find an appropriate slot for an index tuple; store the structures created, the access function generated, and the access function generated in a buffer, and create the C-file based on stored structure, access function and instructions; compile the C-file created using at least one pre-stored compiler; thereby generate the shared object file from said C-file, wherein the shared object file is a dynamic link library file; wherein the shared object file comprises at least one of list of columns in the INDEX, one or more access function for an index tuple value, one or more instructions to find an appropriate slot for an index tuple, and any combination thereof.