Re: [GENERAL] Index using in jsonb query

2017-03-12 Thread Francisco Olarte
On Sun, Mar 12, 2017 at 9:50 AM, SuperCiccio wrote: > But even if I create a specific index > CREATE INDEX on datatable (((jsonfield#>>'{path1,path2}')::numeric)); > it isn't used in such a query; it is used in this query: > select field1,field2 from datatable where > (jsonfield#>>'{path1,path2}')

Re: [GENERAL] Index using in jsonb query

2017-03-12 Thread SuperCiccio
This is a kind of document, there are many other kinds, with different json structure. So, a general index would be better. But even if I create a specific index CREATE INDEX on datatable (((jsonfield#>>'{path1,path2}')::numeric)); it isn't used in such a query; it is used in this query: selec

Re: [GENERAL] Index using in jsonb query

2017-03-11 Thread John R Pierce
On 3/11/2017 3:55 PM, SuperCiccio wrote: Is there a way to make the following query use some sort of indexing? select field1,field2 from datatable where (jsonfield#>>'{path1,path2}')::numeric < 1000; if the '{path1,path2}' part is constant, I'd think you could create an index on (jsonfield #

[GENERAL] Index using in jsonb query

2017-03-11 Thread SuperCiccio
Is there a way to make the following query use some sort of indexing? select field1,field2 from datatable where (jsonfield#>>'{path1,path2}')::numeric < 1000; Thanks

Re: [GENERAL] Index Using

2004-07-19 Thread Stephan Szabo
On Mon, 19 Jul 2004, Michal Hlavac wrote: > hello, > > I have in db table with 3 columns... table name is l_model_to_part > columns: i_model_id, i_part_id, i_year > > I have index on every column separately and primary key is (i_model_id, > i_part_id, i_year) > > when I use: EXPLAIN SELECT * FROM

Re: [GENERAL] Index Using

2004-07-19 Thread Michal Hlavac
Michal Hlavac wrote: > my question is, why postgres doesn't use index_50 in second query??? > when I create this structure in clear db, everything is all right... > of course, index_50 is BTREE index with one column (i_model_id)... thanx, hlk -- [ miso hlavac ][ [EMAIL PROTECTED] ][ http://hlavki.s

[GENERAL] Index Using

2004-07-19 Thread Michal Hlavac
hello, I have in db table with 3 columns... table name is l_model_to_part columns: i_model_id, i_part_id, i_year I have index on every column separately and primary key is (i_model_id, i_part_id, i_year) when I use: EXPLAIN SELECT * FROM l_model_to_part WHERE i_part_id=234;