. , ,
SELECT *
FROM the_table
WHERE color in ('green', 'blue') AND status = 'STATUS1' ;
, , () , partial index:
CREATE TABLE the_table
(
color text,
status character varying(8)
) ;
CREATE INDEX
ON public.the_table (color)
WHERE status = 'STATUS1' ;
PostgreSQL ( , ), , , enumerated type, . : ( "" ), , ( ), , varchar (8):
CREATE TYPE status_type AS ENUM
('STATUS1',
'STATUS2',
'STATUS3');
:
CREATE TABLE the_table
(
color text,
status status_type
) ;
(), (, ), > .
, [ish] (anonymous_id_PK, status_value).