Возможно не используются индекс при выборке с критерием WHERE

_Dimas2003_

Новичок
Возможно не используются индекс при выборке с критерием WHERE

Возможно не используются индекс при выборке с критерием WHERE

ie_db=# \d transactionext;
Table "public.transactionext"
Column | Type | Modifiers
---------------+-----------------------------+-----------
transaction_ | bigint | not null
productname | character varying(50) |
purchased | smallint |
verified | smallint |
productrating | smallint |
price | real |
store | character varying(150) |
storerating | smallint |
merfirstname | character varying(35) |
merlastname | character varying(35) |
addtime | timestamp without time zone |
merchant_ | bigint |
Indexes:
"transactionext_merchant_index" btree (merchant_)
Foreign-key constraints:
"$1" FOREIGN KEY (merchant_) REFERENCES merchant(merchant_) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE


ie_db=# \d "transactionext_merchant_index"

Index "public.transactionext_merchant_index"
Column | Type
-----------+--------
merchant_ | bigint
btree, for table "public.transactionext"

ie_db=# explain select * from transactionext where merchant_=10000;
QUERY PLAN
--------------------------------------------------------------------
Seq Scan on transactionext (cost=0.00..27206.04 rows=12 width=82)
Filter: (merchant_ = 10000)
(2 rows)


VACUUM transactionext;
ANALYZE transactionext;
не помогают
 

Sad Spirit

мизантроп (Старожил PHPClub)
Команда форума
вопрос из официального FAQ PostgreSQL, кстати

Код:
explain select * from transactionext where merchant_=10000::bigint;
 
Сверху