Re: [GENERAL] grep -f keyword data query

2016-01-05 Thread Hiroyuki Sato
Hello Arjen. Thank you for replying. I'll try OR query on my environment. Thanks. 2016年1月4日(月) 23:03 Arjen Nienhuis : > > On Jan 4, 2016 09:45, "Hiroyuki Sato" wrote: > > > > Hello Arjen > > > > Thank you for replying. > > > > 2016年1月4日(月) 16:49 Arjen Nienhuis : > >> > >> > >> On Dec 28, 201

Re: [GENERAL] grep -f keyword data query

2016-01-04 Thread Arjen Nienhuis
On Jan 4, 2016 09:45, "Hiroyuki Sato" wrote: > > Hello Arjen > > Thank you for replying. > > 2016年1月4日(月) 16:49 Arjen Nienhuis : >> >> >> On Dec 28, 2015 00:55, "Hiroyuki Sato" wrote: >> > >> > Hello Andreas and Tom >> > >> > Thank you for replying. >> > >> > Sorry, I re-created my questions. I w

Re: [GENERAL] grep -f keyword data query

2016-01-04 Thread Hiroyuki Sato
Hello Arjen Thank you for replying. 2016年1月4日(月) 16:49 Arjen Nienhuis : > > On Dec 28, 2015 00:55, "Hiroyuki Sato" wrote: > > > > Hello Andreas and Tom > > > > Thank you for replying. > > > > Sorry, I re-created my questions. I was mis-pasted query log on previous > question. > > (@~ operator i

Re: [GENERAL] grep -f keyword data query

2016-01-04 Thread Hiroyuki Sato
Hello David Thank your for your comment. 2015年12月30日(水) 10:15 David Rowley : > On 30 December 2015 at 13:56, Hiroyuki Sato wrote: > >> 2015年12月30日(水) 6:04 David Rowley : >> >>> On 30 December 2015 at 04:21, Hiroyuki Sato wrote: >>> 2015年12月29日(火) 4:35 Jeff Janes : > > Bu

Re: [GENERAL] grep -f keyword data query

2016-01-03 Thread Arjen Nienhuis
On Dec 28, 2015 00:55, "Hiroyuki Sato" wrote: > > Hello Andreas and Tom > > Thank you for replying. > > Sorry, I re-created my questions. I was mis-pasted query log on previous question. > (@~ operator is PGroonga extension (http://pgroonga.github.io)) > Please ignore it. > > Best regards. > > 1,

Re: [GENERAL] grep -f keyword data query

2015-12-29 Thread David Rowley
On 30 December 2015 at 13:56, Hiroyuki Sato wrote: > 2015年12月30日(水) 6:04 David Rowley : > >> On 30 December 2015 at 04:21, Hiroyuki Sato wrote: >> >>> 2015年12月29日(火) 4:35 Jeff Janes : >>> >>> But, the planner refuses to use this index for your query anyway, because it can't see th

Re: [GENERAL] grep -f keyword data query

2015-12-29 Thread Hiroyuki Sato
Hello David Thank you for replying. 2015年12月30日(水) 6:04 David Rowley : > On 30 December 2015 at 04:21, Hiroyuki Sato wrote: > >> 2015年12月29日(火) 4:35 Jeff Janes : >> >>> >>> >> But, the planner refuses to use this index for your query anyway, >>> because it can't see that the patterns are all le

Re: [GENERAL] grep -f keyword data query

2015-12-29 Thread David Rowley
On 30 December 2015 at 04:21, Hiroyuki Sato wrote: > 2015年12月29日(火) 4:35 Jeff Janes : > >> >> > >> But, the planner refuses to use this index for your query anyway, >> because it can't see that the patterns are all left-anchored. >> >> Really, your best bet is refactor your url data so it is stor

Re: [GENERAL] grep -f keyword data query

2015-12-29 Thread Hiroyuki Sato
Hello Jeff Thank you for replying. 2015年12月29日(火) 4:35 Jeff Janes : > On Sun, Dec 27, 2015 at 3:53 PM, Hiroyuki Sato > wrote: > > Hello Andreas and Tom > > > > Thank you for replying. > > > > Sorry, I re-created my questions. I was mis-pasted query log on previous > > question. > > (@~ operator

Re: [GENERAL] grep -f keyword data query

2015-12-29 Thread Hiroyuki Sato
Hello Tom. Thank you for replying. This is Gin Index result. It is slow too. Best regards. -- Hiroyuki Sato 1, create.sql drop table if exists url_lists4; create table url_lists4 ( id int not null primary key, url text not null ); --create index ix_url_url_lists4

Re: [GENERAL] grep -f keyword data query

2015-12-28 Thread Jeff Janes
On Sun, Dec 27, 2015 at 3:53 PM, Hiroyuki Sato wrote: > Hello Andreas and Tom > > Thank you for replying. > > Sorry, I re-created my questions. I was mis-pasted query log on previous > question. > (@~ operator is PGroonga extension (http://pgroonga.github.io)) > Please ignore it. > > Best regards.

Re: [GENERAL] grep -f keyword data query

2015-12-28 Thread Tom Lane
Hiroyuki Sato writes: > I re-created index with pg_trgm. > Execution time is 210sec. > Yes It is faster than btree index. But still slow. > It is possible to improve this query speed? > Should I use another query or idex? Did you try a GIN index? regards, tom lane -- S

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Hiroyuki Sato
Hello Tom. Thank you for replying. I re-created index with pg_trgm. Execution time is 210sec. Yes It is faster than btree index. But still slow. It is possible to improve this query speed? Should I use another query or idex? Best regards. 1, query SELECT u.url FROM url_list

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Tom Lane
Hiroyuki Sato writes: > Sorry, I re-created my questions. I was mis-pasted query log on previous > question. > (@~ operator is PGroonga extension (http://pgroonga.github.io)) > [ "like" is actually the operator of interest ] Ah. You might get some good results with trigram indexes (ie, contrib/p

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Hiroyuki Sato
Hello Andreas and Tom Thank you for replying. Sorry, I re-created my questions. I was mis-pasted query log on previous question. (@~ operator is PGroonga extension (http://pgroonga.github.io)) Please ignore it. Best regards. 1, Problem. (1) Following query is exteme slow. (478sec) SELECT

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Tom Lane
Andreas Kretschmer writes: >> Tom Lane hat am 27. Dezember 2015 um 19:11 geschrieben: >> What in the world is this @~ operator? And what sort of index are >> you using now, that can accept it? Are the rowcount estimates in >> the EXPLAIN output accurate? (If they are, it's hardly surprising >>

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Andreas Kretschmer
> Tom Lane hat am 27. Dezember 2015 um 19:11 geschrieben: > > > Hiroyuki Sato writes: > > I would like to create the query like the following. > > It work well, but extreme slow. > > ... > > Explain output. > > > Nested Loop (cost=0.45..1570856063.28 rows=5712200 width=57) > >-> I

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Tom Lane
Hiroyuki Sato writes: > I would like to create the query like the following. > It work well, but extreme slow. > ... > Explain output. > Nested Loop (cost=0.45..1570856063.28 rows=5712200 width=57) >-> Index Scan using ix_name_keywords on keywords k (cost=0.28..221.78 > rows=5000 wid

Re: [GENERAL] grep -f keyword data query

2015-12-27 Thread Andreas Kretschmer
Hiroyuki Sato wrote: > Hello. > > I would like to create the query like the following. > It work well, but extreme slow. > Is it possible to improve this query like the command ``grep -f keyword > data``? > > What kind of Index should I create on url_lists table? can you show us the create ta

[GENERAL] grep -f keyword data query

2015-12-27 Thread Hiroyuki Sato
Hello. I would like to create the query like the following. It work well, but extreme slow. Is it possible to improve this query like the command ``grep -f keyword data``? What kind of Index should I create on url_lists table? Detail https://gist.github.com/hiroyuki-sato/574b8ea5d9396e455d60 SE