mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-09 18:04:33 +02:00
Add database indices to improve performance
This commit is contained in:
parent
9d069149d7
commit
ed91ffc60a
17 changed files with 193 additions and 18 deletions
|
@ -33,7 +33,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Class AttachmentType.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Parts\CategoryRepository")
|
||||
* @ORM\Table(name="`categories`")
|
||||
* @ORM\Table(name="`categories`", indexes={
|
||||
* @ORM\Index(name="name_idx", columns={"name"}),
|
||||
* @ORM\Index(name="parent_name_idx", columns={"parent_id", "name"}),
|
||||
* })
|
||||
*/
|
||||
class Category extends AbstractPartsContainingDBElement
|
||||
{
|
||||
|
|
|
@ -61,7 +61,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Class Footprint.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Parts\FootprintRepository")
|
||||
* @ORM\Table("`footprints`")
|
||||
* @ORM\Table("`footprints`", indexes={
|
||||
* @ORM\Index(name="name_idx", columns={"name"}),
|
||||
* @ORM\Index(name="parent_name_idx", columns={"parent_id", "name"}),
|
||||
* })
|
||||
*/
|
||||
class Footprint extends AbstractPartsContainingDBElement
|
||||
{
|
||||
|
|
|
@ -61,7 +61,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Class Manufacturer.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Parts\ManufacturerRepository")
|
||||
* @ORM\Table("`manufacturers`")
|
||||
* @ORM\Table("`manufacturers`", indexes={
|
||||
* @ORM\Index(name="name_idx", columns={"name"}),
|
||||
* @ORM\Index(name="parent_name_idx", columns={"parent_id", "name"}),
|
||||
* })
|
||||
*/
|
||||
class Manufacturer extends AbstractCompany
|
||||
{
|
||||
|
|
|
@ -55,7 +55,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* This could be something like N, grams, meters, etc...
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Parts\MeasurementUnitRepository")
|
||||
* @ORM\Table(name="`measurement_units`")
|
||||
* @ORM\Table(name="`measurement_units`", indexes={
|
||||
* @ORM\Index(name="name_idx", columns={"name"}),
|
||||
* @ORM\Index(name="parent_name_idx", columns={"parent_id", "name"}),
|
||||
* })
|
||||
* @UniqueEntity("unit")
|
||||
*/
|
||||
class MeasurementUnit extends AbstractPartsContainingDBElement
|
||||
|
|
|
@ -75,7 +75,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Otherwise this class would be too big, to be maintained.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\PartRepository")
|
||||
* @ORM\Table("`parts`")
|
||||
* @ORM\Table("`parts`", indexes={
|
||||
* @ORM\Index(name="parts_idx_datet_name_last_id_needs", columns={"datetime_added", "name", "last_modified", "id", "needs_review"}),
|
||||
* @ORM\Index(name="parts_idx_name", columns={"name"}),
|
||||
* })
|
||||
*/
|
||||
class Part extends AttachmentContainingDBElement
|
||||
{
|
||||
|
|
|
@ -58,7 +58,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* It is the connection between a part and its store locations.
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="part_lots")
|
||||
* @ORM\Table(name="part_lots", indexes={
|
||||
* @ORM\Index(name="part_lots_idx_instock_un_expiration_id_part", columns={"instock_unknown", "expiration_date", "id_part"}),
|
||||
* @ORM\Index(name="part_lots_idx_needs_refill", columns={"needs_refill"}),
|
||||
* })
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ValidPartLot()
|
||||
*/
|
||||
|
|
|
@ -61,7 +61,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Class Store location.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Parts\StorelocationRepository")
|
||||
* @ORM\Table("`storelocations`")
|
||||
* @ORM\Table("`storelocations`", indexes={
|
||||
* @ORM\Index(name="name_idx", columns={"name"}),
|
||||
* @ORM\Index(name="parent_name_idx", columns={"parent_id", "name"}),
|
||||
* })
|
||||
*/
|
||||
class Storelocation extends AbstractPartsContainingDBElement
|
||||
{
|
||||
|
|
|
@ -65,7 +65,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Class Supplier.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Parts\SupplierRepository")
|
||||
* @ORM\Table("`suppliers`")
|
||||
* @ORM\Table("`suppliers`", indexes={
|
||||
* @ORM\Index(name="name_idx", columns={"name"}),
|
||||
* @ORM\Index(name="parent_name_idx", columns={"parent_id", "name"}),
|
||||
* })
|
||||
*/
|
||||
class Supplier extends AbstractCompany
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue