Search Postgresql Archives

Re: How to create index on only some of the rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 7, 2011, at 11:00 PM, A B wrote:
> So until this changes, can you just add a boolean field to tell if the
> column should be used in the index, and then run  "create index ....
> where use_in_index = true"  or are there other (better?) ways of doing
> this?


If you want you can do that Or You can use proper where clause as given below:
CREATE INDEX indexname on tablename(columname) where condition;

example:
create index directed_graph_idx on directed_graph(node_from) where node_from in ('A','B');
	
Thanks & Regards,
Vibhor Kumar
vibhor.kumar@xxxxxxxxxxxxxxxx
Blog:http://vibhork.blogspot.com


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux