Multiplication of database objects

A method for multiplying an object in a database may include receiving, from a client, an indication that an object is associated with a first variable attribute having a first variation and a second variation. A bucket may be created in response to the indication. The bucket may include the object, a first sub-object having a first reference to the first variation of the first variable attribute, and a second sub-object having a second reference to the second variation of the first variable attribute. The bucket may be created instead of a first object having the first variation of the first variable attribute and a second object having the second variation of the first variable attribute. The bucket stored in the database may be accessed in response to a query from the client accessing the object. Related systems and articles of manufacture including computer program products are also provided.

TECHNICAL FIELD

The subject matter described herein relates generally to database processing and more specifically to the multiplication of database objects.

BACKGROUND

Data stored in a database may be organized in accordance with a schema. For example, the schema of a database may define the structure of the database including, for example, tables, relationships, views, indices, and/or the like. The schema may include objects that represent different data elements. For example, in a procurement and inventory system, an object may be a line item corresponding to an article. As such, each object may include one or more attributes associated with a corresponding article. Furthermore, the relationships between two or more objects may reflect the relationships between the corresponding articles.

SUMMARY

Systems, methods, and articles of manufacture, including computer program products, are provided for multiplying objects in a database. In one aspect, there is provided a system. The system may include at least one data processor and at least one memory. The at least one memory may store instructions that result in operations when executed by the at least one data processor. The operations may include receiving, from a client, an indication that an object is associated with a first variable attribute having a first variation and a second variation. The operations may further include responding to the indication by at least creating, at a database, a bucket that includes the object, a first sub-object, and a second sub-object. The first sub-object may have a first reference to the first variation of the first variable attribute. The second sub-object may have a second reference to the second variation of the first variable attribute. The bucket stored in the database may be accessed in response to a query from the client accessing the object.

In some variations, one or more features disclosed herein including the following features can optionally be included in any feasible combination. The bucket may be created at the database instead of a first object having the first variation of the first variable attribute and a second object having the second variation of the first variable attribute.

In some variations, the object may include a multiplier term. The multiplier term may be an array and/or a matrix storing the first variation of the first variable attribute and the second variation of the first variable attribute. The first reference and the second reference may be pointers to first variation of the first variable attribute and the second variation of the first variable attribute stored in the multiplier term.

In some variations, another indication that the object is associated with a second variable attribute having a third variation and a fourth variation may be received from the client. The bucket may be created to include a third sub-object and a fourth sub-object in response to the other indication. The first sub-object may include the first reference to the first variation of the first variable attribute and a third reference to the third variation of the second variable attribute. The second sub-object may include the second reference to the second variation of the first variable attribute and a fourth reference to the third variation of the second variable attribute. The third sub-object may include a fifth reference to the first variation of the first variable attribute and a sixth reference to the fourth variation of the second variable attribute. The fourth sub-object may include a seventh reference to the second variation of the first variable attribute and an eighth reference to the fourth variation of the second variable attribute

In some variations, the first sub-object and the second sub-object may each include a reference to the object.

In some variations, the method may further include responding to the query by at least generating, based at least on the bucket, a user interface for displaying the object. The user interface may display the first sub-object and the second sub-object as a single line item. The user interface may display a first line item corresponding to the first sub-object and a second line item corresponding to the second sub-object.

In some variations, the object may further include one or more common attributes.

In another aspect, there is provided a method. The method may include receiving, from a client, an indication that an object is associated with a first variable attribute having a first variation and a second variation. The operations may further include responding to the indication by at least creating, at a database, a bucket that includes the object, a first sub-object, and a second sub-object. The first sub-object may have a first reference to the first variation of the first variable attribute. The second sub-object may have a second reference to the second variation of the first variable attribute. The bucket stored in the database may be accessed in response to a query from the client accessing the object.

In some variations, one or more features disclosed herein including the following features can optionally be included in any feasible combination. The bucket may be created at the database instead of a first object having the first variation of the first variable attribute and a second object having the second variation of the first variable attribute.

In some variations, the object may include a multiplier term. The multiplier term may be an array and/or a matrix storing the first variation of the first variable attribute and the second variation of the first variable attribute. The first reference and the second reference may be pointers to first variation of the first variable attribute and the second variation of the first variable attribute stored in the multiplier term.

In some variations, another indication that the object is associated with a second variable attribute having a third variation and a fourth variation may be received from the client. The bucket may be created to include a third sub-object and a fourth sub-object in response to the other indication. The first sub-object may include the first reference to the first variation of the first variable attribute and a third reference to the third variation of the second variable attribute. The second sub-object may include the second reference to the second variation of the first variable attribute and a fourth reference to the third variation of the second variable attribute. The third sub-object may include a fifth reference to the first variation of the first variable attribute and a sixth reference to the fourth variation of the second variable attribute. The fourth sub-object may include a seventh reference to the second variation of the first variable attribute and an eighth reference to the fourth variation of the second variable attribute

In some variations, the first sub-object and the second sub-object may each include a reference to the object.

In some variations, a user interface for displaying the object may be generated based at least on the bucket, in response to the query. The user interface may display the first sub-object and the second sub-object as a single line item. The user interface may display a first line item corresponding to the first sub-object and a second line item corresponding to the second sub-object.

In another aspect, there is provided a computer program product that includes a non-transitory computer readable medium. The non-transitory computer readable medium may store instructions that result in operations when executed by at least one data processor. The operations may include receiving, from a client, an indication that an object is associated with a first variable attribute having a first variation and a second variation. The operations may further include responding to the indication by at least creating, at a database, a bucket that includes the object, a first sub-object, and a second sub-object. The first sub-object may have a first reference to the first variation of the first variable attribute. The second sub-object may have a second reference to the second variation of the first variable attribute. The bucket stored in the database may be accessed in response to a query from the client accessing the object.

DETAILED DESCRIPTION

Each object in a database may include one or more attributes. For example, an object in a procurement and inventory system may be a line item corresponding to an article. Accordingly, the object may include at least an attribute for a supplier providing the article. In a conventional database, multiple objects may be generated for a single article in order to account for variations in a small subset of attributes associated with the article. For instance, a different object may be generated for each supplier of the same article even when other attributes for the article remain the same. Multiplying objects in this manner may result in a proliferation of nearly identical objects in the database. As such, a query to the database may return a multitude of objects for substantially the same article, with the objects differing only with respect to a few attributes such as, for example, the supplier providing the article.

In some example embodiments, to avoid the proliferation of nearly identical objects in a database, a bucket may be created in order to associate an object with a multiplier term that includes variations for a subset of the attributes associated with the object. The bucket may include the object and one or more sub-objects. Each of the one or more sub-objects may be mapped to the object, for example by at least containing a reference to the object. Furthermore, each sub-objects may hold a reference to one variation of an attribute associated with the object. In instances where the object is associated with multiple variable attributes, the bucket may include a sub-object for every combination of variations in the attributes associated with the object.

For example, the bucket may associate an object corresponding to an article with a multiplier term that includes variations for a supplier of the article. As such, each sub-objects included in the bucket may be mapped to the object corresponding to the article. Moreover, each sub-objects included in the bucket may hold a reference to a supplier providing the article. Accordingly, the bucket may include a first sub-objects corresponding to the article being provided by a first supplier and a second sub-objects corresponding to the article being provided by a second supplier.

FIG. 1depicts a system diagram illustrating a database system100, in accordance with some example embodiments. Referring toFIG. 1, the database system100may include a database management system110and a database120. The database120may be any type of database including, for example, an in-memory database, a relational database, a non-SQL (NoSQL) database, and/or the like. Meanwhile, the database management system110may support a variety of operations (e.g., structured query language (SQL) statements) for accessing the data stored in the database120. As shown inFIG. 1, a client140may query the database120by at least sending, to the database management system110, one or more requests to perform the operations (e.g., SQL statements) for accessing the data stored in the database120.

Referring again toFIG. 1, the database management system110, the database120, and/or the client140may be communicatively coupled via a network130. It should be appreciated that the network130may be any wired and/or wireless network including, for example, a local area network (LAN), a wide area network (WAN), a virtual local area network (VLAN), a public land mobile network (PLMN), the Internet, and/or the like. The client140may be any processor based device including, for example, a smartphone, a tablet computer, a laptop computer, a workstation, and/or the like.

The database120may store data in accordance with a schema, which may define the structure of the database120including, for example, tables, relationships, views, indices, and/or the like. As noted, the schema of the database120may include one or more objects. For instance, the database120may implement a procurement and inventory system. Accordingly, the objects in the database120may correspond to different articles such as, for example, different types of grocery items (e.g., baked goods, produce, dairy products, and/or the like). However, it should be appreciated that the database120may also be schema-less and store data in the form of one or more key-value pairs.

As shown inFIG. 1, the database management system110may include an object multiplication115. In some example embodiments, an object stored in the database120may be associated with a set of attributes. In order to account for variations in a subset of the attributes associated with the object without generating multiple nearly identical objects that differ only with respect to the subset of attributes, the object multiplication115may create a bucket associating the object with a multiplier term. The multiplier term may include, for example, an array and/or a matrix storing variations in the subset of attributes. Meanwhile, each sub-objects in the bucket may be mapped to the object as well as a reference to one variation of an attribute associated with the object. As used herein, a reference may be a pointer holding, for example, a memory address of a variation of an attribute stored in the multiplier term.

For example, an object corresponding to an article may have one or more variable attributes including, for example, the supplier providing the article. Instead of generating a different object for each supplier providing the article, the object multiplication115may create a bucket associating an object corresponding to the article to a multiplier term that includes variations in the supplier providing the article. The object may include one or more common attributes of the article, which may remain static. Meanwhile, the bucket may include the object. Furthermore, the bucket may include different sub-objects, each of which corresponding to a variation of the one or more variable attributes associated with the article such as, for example, the supplier providing the article. For instance, the bucket may include a first sub-objects corresponding to the article being provided by a first supplier and a second sub-objects corresponding to the article being provided by a second supplier. The first sub-objects may include a reference to the object corresponding to the article as well as a reference to the first supplier in the multiplier term. Alternatively and/or additionally, the second sub-objects may also include reference to the object corresponding to the article and a reference to the second supplier in the multiplier term.

In some example embodiments, the database120may store the bucket instead of a different object for each supplier providing the article. Moreover, when the client140queries the database120regarding the article, the database management system110may respond to the query by accessing the bucket instead of a multitude of objects that differ only with respect to the supplier providing the article. For example, the bucket may include the first sub-objects corresponding to the article being provided by the first supplier and the second sub-objects corresponding to the article being provided by the second supplier. The first sub-objects and the second sub-objects may be mapped to a single object corresponding to the article. Moreover, the first sub-objects may include a reference to the first supplier in the multiplier term while the second sub-objects may include a reference to the second supplier in the multiplier term. The database management system110may respond to the query at least by accessing the bucket including, for example, the first sub-objects and/or the second sub-objects, instead of a first object corresponding to the article being provided by the first supplier and the second object corresponding to the article being provided by the second supplier.

To further illustrate,FIG. 2depicts a block diagram illustrating an example of a bucket200, in accordance with some example embodiments. In some example embodiments, the object multiplier115may generate the bucket200in order to account for variations in a subset of attributes associated with an object210. The object210may be a line item corresponding to an article such as, for example, yogurt. As shown inFIG. 2, the object210may include one or more common attributes212. The one or more common attributes212may include an n quantity of attributes a (e.g., a1, a2, . . . an), which may remain static. Alternatively and/or additionally, the object210may include a multiplier term214. The multiplier term214may include an array and/or a matrix storing one or more variable attributes of the object210. For example, the multiplier term214may include an array and/or a matrix that hold the different suppliers for the yogurt including, for example, a first supplier s1, a second supplier s2, and/or the like. The array and/or the matrix may further hold different fat content available for the yogurt including, for example, a first fat content f1, a second fat content f2, and/or the like.

Referring again toFIG. 2, in order to account for variations in the supplier providing the yogurt and the fat content of the yogurt corresponding to the object210, the object multiplier115may create the bucket200. In some example embodiments, the bucket200may include the object210. Moreover, the bucket200may include one or more sub-objects, each of which being mapped to the object210and a variation of an attribute included in the multiplier term214. That is, the bucket200may include a sub-object for each combination of the variations in the supplier providing the yogurt (e.g., the first supplier s1and the second supplier s2) and the fat content of the yogurt (e.g., the first fat content f1and the second fat content f2).

For example, the bucket200may include a first sub-object220, a second sub-object230, a third sub-object240, a fourth sub-object250, and/or the like. The first sub-object220may include a first reference225A to the object210and a second reference225B to the first supplier s1included in the multiplier term214, and a third reference225C to the first fat content f1included in the multiplier term214. As such, the first sub-object220may correspond to a yogurt provided by the first supplier s1and having the first fat content f1. Alternatively and/or additionally, the second sub-object230may correspond to a yogurt having the first fat content f1but is provided by the second supplier s2. Accordingly, the second sub-object230may include a fourth reference235A to the object210, a fifth reference235B to the second supplier s2included in the multiplier term214, and a sixth reference to the first fat content f1. included in the multiplier term214.

The third sub-object240may correspond to a yogurt provided by the second supplier s2and having the first fat content f1whereas the fourth sub-object250may correspond to a yogurt provided by the first supplier s1and having the second fat content f2. Accordingly, the third sub-object240may include a seventh reference245A to the object210, an eighth reference245B to the second supplier s2included in the multiplier term214, and a ninth reference245C to the first fat content f1included in the multiplier term214. Meanwhile, the fourth sub-object250may include a tenth reference255A to the object210, an eleventh reference255B to the first supplier s1included in the multiplier term214, and a twelfth reference255C to the second fat content f2included in the multiplier term214.

In some example embodiments, the bucket200may be stored in the database120instead of multiple nearly identical objects for yogurts that differ only with respect to the fat content of the yogurt and/or the supplier providing the yogurt. As such, by generating the bucket200, the object multiplier115may avoid a proliferation of nearly identical objects in the database120. Furthermore, when the client140queries for the object210, the database management system110may respond to the query by providing a single line item that includes yogurts having different fat content and provided by different suppliers instead of multiple nearly identical line items. Alternatively and/or additionally, the database management system110may respond to the query by providing multiple line items, each of which corresponding to a yogurt having a different fat content and/or provided by a different supplier.

FIG. 3A-Edepicts examples of user interfaces for interacting with the database management system110including, for example, the multiplication engine115, to create and/or access the bucket200. For example,FIG. 3Adepicts a user interface300for creating the object210in the database120, in accordance with some example embodiments. In some example embodiments, the database management system110may generate the user interface300for display at the client140. As shown inFIG. 3A, the client140may create the object210by at least specifying one or more attributes associated with the object210, which may include, for example, the common attributes212and the variable attributes included in the multiplier term214.

FIGS. 3B-Cdepicts a user interface310for creating the multiplier term114, in accordance with some example embodiments. The database management system110may generate the user interface310for display at the client140such that the client140is able to create the multiplier term114. In some example embodiments, the client140may create the multiplier term114by at least specifying one or more variable attributes of the object210. For instance, as shown inFIG. 3B, the client140may specify, at least by providing one or more inputs via the user interface310, fat content as a variable attribute. Furthermore, the client140may specify, by inputs provided via the user interface310, the first fat content f1and the second fat content f2as variations in the fat content of the yogurt. In doing so, the client140may add, to the multiplier term114, the variations in the fat content of the yogurt including, for example, the first fat content f1and the second fat content f2. Alternatively and/or additionally,FIG. 3Cshows that the client140may also specify, by inputs provided via the user interface310, supplier as a variable attribute. The client140may further specify, by inputs provided via the user interface310, the first supplier s1and the second supplier s2as variations in the supplier providing the yogurt. In doing so, the client140may add, to the multiplier term114, the variations in the supplier providing the yogurt including, for example, the first supplier s1and the second supplier s2.

FIG. 3Ddepicts a user interface320displaying the object210, in accordance with some example embodiments. In some example embodiments, the database management system110may generate the user interface320in response to a query from the client140to access the object200. The database management system110may generate, based at least on the bucket200, the user interface320for displaying the object210including, for example, yogurts having different fat content and/or provided by different suppliers. As shown inFIG. 3D, the object210may be displayed as multiple line items, each of which corresponding to a yogurt provided by a different supplier and/or having a different fat content. For example, the user interface320may display a first line item325A corresponding to the yogurt provided by the first supplier s1and having the first fat content f1, a second line item325B corresponding to the yogurt provided by the second supplier s2and having the first fat content f1, a third line item325C corresponding to the yogurt provided by the first supplier s1and having the second fat content f2, and a fourth line item325D corresponding to the yogurt provided by the second supplier s2and having the second fat content f2. Each of the first line item325A, the second line item325B, the third line item325C, and/or the fourth line item325D may show one or more attributes associated with yogurts that are provided by different suppliers and/or have different fat content. For instance,FIG. 3Dshows the price for yogurts that are provided by different suppliers and/or have different fat content.

FIG. 3Edepicts another user interface330displaying the object210, in accordance with some example embodiments. Instead of and/or in addition to displaying the object210as multiple line items that each correspond to a yogurt provided by a different supplier and/or having a different fat content,FIG. 3Eshows that the object210may also be displayed as a single line item340. Yogurts having different fat content and/or are provided by different suppliers may be organized based on the variable attributes. For instance, as shown inFIG. 3E, the single line item340may include a first column350A for yogurts that are provided by the first supplier s1and a second column350B for yogurts that are provided by the second supplier s2. Each of the first column350A and the second column350B may further include yogurts having different fat content. For example, the first column350A may show the prices of yogurts provided by the first supplier s1and having the first fat content f1as well as the second fat content f2. The second column350B may show the prices of yogurts provided by the second supplier s2and having the first content f1as well as the second fat content f2.

FIG. 4depicts a flowchart illustrating a process400for multiplying an object in a database, in accordance with some example embodiments. Referring toFIGS. 1-2, 3A-E, and4, the process400may be performed by the database management system110, for example, the object multiplier115. The database management system110may perform the process400in order to account for variations in a subset of attributes associated with an object stored in the database110such as, for example, the object210.

At402, the database management system110may receive, from the client140, an indication that an object is associated with a variable attribute having a first variation and a second variation. In some example embodiments, the client140may indicate that the fat content and/or the supplier of a yogurt corresponding to the object210may vary. For example, the client140may indicate, for example, via the user interface310, that the yogurt corresponding to the object210may be provided by multiple suppliers including, for example, the first supplier s1the second supplier s2, and/or the like. Alternatively and/or additionally, client140may indicate, for example, via the user interface310, that the yogurt corresponding to the object210may have different fat contents including, for example, the first fat content f1, the second fat content f2, and/or the like.

At404, the database management system110may respond to the indication by at least creating a bucket that includes the object, a first sub-object having the first variation of the variable attribute, and a second sub-object having the second variation of the variable attribute. In some example embodiments, the database management system110may generate the bucket200in order to account for variations in the fat content and/or the supplier of the yogurt corresponding to the object210. The bucket200may include the object210as well as one or more sub-objects including, for example, the first sub-object220, the second sub-object230, the third sub-object240, the fourth sub-object250, and/or the like. Each of the sub-objects may be mapped to the object210as well as a variation in the fat content and supplier of the corresponding yogurt.

For instance, the bucket200may include a sub-object for each combination of the variations in the supplier providing the yogurt (e.g., the first supplier s1and the second supplier s2) and the fat content of the yogurt (e.g., the first fat content f1and the second fat content f2). As shown inFIG. 2, the bucket200may include the first sub-object220corresponding to the yogurt provided by the first supplier s1and having the first fat content f1, the second sub-object230corresponding to the yogurt provided by the second supplier s2and having the first fat content f1, the third sub-object240corresponding to the yogurt provided by the second supplier s2and having the first fat content f1, and/or the fourth sub-object250may correspond to a yogurt provided by the first supplier s1and having the second fat content f2.

At406, the database management system110may access the bucket stored in a database in response to a query from the client140accessing the corresponding object. In some example embodiments, the bucket200may be stored at the database120instead of multiple nearly identical objects for each yogurt that differ only with respect to a subset of the attributes of the object210including, for example, the supplier providing the yogurt and/or the fat content of the yogurt. As such, when the client140queries the database120to access the object210, the database management system110may respond to the query by at least accessing the bucket200. Furthermore, the database management system110may display the object210as a single line item and/or as multiple line items.

For example, as shown inFIG. 3D, the database management system110may generate the user interface320for displaying the object210as multiple line items including, for example, the first line item325A, the second line item325B, the third line item325C, and/or the fourth line item325D. Each line item shown in the user interface320may correspond to a yogurt provided by a different supplier and/or having a different fat content. For instance, the first line item325A may correspond to the yogurt provided by the first supplier s1and having the first fat content f1, the second line item325B may correspond to the yogurt provided by the second supplier s2and having the first fat content f1, the third line item325C may correspond to the yogurt provided by the first supplier s1and having the second fat content f2, and the fourth line item325D may correspond to the yogurt provided by the second supplier s2and having the second fat content f2. As noted, each of the first line item325A, the second line item325B, the third line item325C, and/or the fourth line item325D may show one or more attributes associated with yogurts that are provided by different suppliers and/or have different fat content such as, for example, the price of yogurts provided by different suppliers and/or have different fat content.

Alternatively and/or additionally, as shown inFIG. 3E, the database management system110may generate the user interface330for displaying the object210as the single line item340. The single line item340may include the first column350A for yogurts that are provided by the first supplier s1and the second column350B for yogurts that are provided by the second supplier s2. Each of the first column350A and the second column350B may further include yogurts having different fat content. For example, the first column350A may show the prices of yogurts provided by the first supplier s1and having the first fat content f1as well as the second fat content f2. The second column350B may show the prices of yogurts provided by the second supplier s2and having the first content f1as well as the second fat content f2.

FIG. 5depicts a block diagram illustrating a computing system500consistent with implementations of the current subject matter. Referring toFIGS. 1 and 5, the computing system500can be used to implement the database management system110and/or any components therein.

As shown inFIG. 5, the computing system500can include a processor510, a memory520, a storage device530, and input/output devices540. The processor510, the memory520, the storage device530, and the input/output devices540can be interconnected via a system bus550. The processor510is capable of processing instructions for execution within the computing system500. Such executed instructions can implement one or more components of, for example, the database management system110. In some example embodiments, the processor510can be a single-threaded processor. Alternately, the processor510can be a multi-threaded processor. The processor510is capable of processing instructions stored in the memory520and/or on the storage device530to display graphical information for a user interface provided via the input/output device540.

The memory520is a computer readable medium such as volatile or non-volatile that stores information within the computing system500. The memory520can store data structures representing configuration object databases, for example. The storage device530is capable of providing persistent storage for the computing system500. The storage device530can be a floppy disk device, a hard disk device, an optical disk device, or a tape device, or other suitable persistent storage means. The input/output device540provides input/output operations for the computing system500. In some example embodiments, the input/output device540includes a keyboard and/or pointing device. In various implementations, the input/output device540includes a display unit for displaying graphical user interfaces.