mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 17:51:39 +02:00
✨ Add missing indexes and improve others.
This commit is contained in:
parent
c1476d0397
commit
60f4f863df
5 changed files with 40 additions and 5 deletions
|
@ -10,11 +10,17 @@ CREATE TABLE storage_object (
|
|||
metadata jsonb NULL DEFAULT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX storage_object__id__deleted_at__idx
|
||||
ON storage_object(id, deleted_at)
|
||||
WHERE deleted_at IS NOT null;
|
||||
|
||||
CREATE TABLE storage_data (
|
||||
id uuid PRIMARY KEY REFERENCES storage_object (id) ON DELETE CASCADE,
|
||||
data bytea NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX storage_data__id__idx ON storage_data(id);
|
||||
|
||||
-- Table used for store inflight upload ids, for later recheck and
|
||||
-- delete possible staled files that exists on the phisical storage
|
||||
-- but does not exists in the 'storage_object' table.
|
||||
|
@ -28,8 +34,3 @@ CREATE TABLE storage_pending (
|
|||
PRIMARY KEY (created_at, id)
|
||||
);
|
||||
|
||||
CREATE INDEX storage_data__id__idx ON storage_data(id);
|
||||
CREATE INDEX storage_object__id__deleted_at__idx
|
||||
ON storage_object(id, deleted_at)
|
||||
WHERE deleted_at IS NOT null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue