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-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

[GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christopher Molnar
Hello all! Sorry to have to ask the experts here for some regex assistance again. I am admittadly awful with these and could use some help. Have the following string (this is an example) that needs to be changed. Need to use a search and replace because the links across over 200K records are simi

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Melvin Davidson
Chris, First, even though it may or may not apply in this instance, it is ALWAYS a good idea (and good manners) to provide the PostgreSQL version and your O/S when posting to this board. I have also previously replied that the following should work: UPDATE pcilms_assign SET intro = REPLACE (i

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christoph Moench-Tegeder
## Christopher Molnar (cmolna...@gmail.com): > I have tried something like: > > update pcilms_assign set intro=regexp_replace(intro, '/([^/]*)\" title=$', > '&files=\1') where intro like '%https://owncloud.porterchester.edu%' and > course=18 and id=55413; http://blog.codinghorror.com/parsing-ht

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christoph Moench-Tegeder
## Melvin Davidson (melvin6...@gmail.com): > UPDATE pcilms_assign >SET intro = REPLACE (intro, 'HVACR1114_LAB_13A.pdf', > '&file=HVACR1114_LAB_13A.pdf') > WHERE intro like 'https://owncloud.porterchester.edu%' > AND course=18 and id=55413; Unfortunately, that tries to do the right th

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] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Michael Nolan
On Mon, Dec 28, 2015 at 2:08 PM, Christopher Molnar wrote: > Hello all! > > Sorry to have to ask the experts here for some regex assistance again. I > am admittadly awful with these and could use some help. > > Any suggestions? > I have found over the years that it is far easier to write a short

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread David G. Johnston
On Tue, Dec 29, 2015 at 2:26 PM, Michael Nolan wrote: > On Mon, Dec 28, 2015 at 2:08 PM, Christopher Molnar > wrote: > >> Hello all! >> >> Sorry to have to ask the experts here for some regex assistance again. I >> am admittadly awful with these and could use some help. >> >> Any suggestions? >>

[GENERAL] cannot get stable function to use index

2015-12-29 Thread Andy Colson
Hi all, I seem to be missing something. I'm using PG 9.3.9 on Slackware64. My table: create table search ( gid integer, descr text, search_vec tsvector ); create index search_key on search using gin(search_vec); I've put a bunch of data in it, and using to_tsquery use

Re: [GENERAL] cannot get stable function to use index

2015-12-29 Thread David G. Johnston
On Tue, Dec 29, 2015 at 3:52 PM, Andy Colson wrote: > ​[...]​ > > Originally it didn't have "STABLE STRICT", but I added it. Doesn't seem > to matter though. I cannot get this sql to use the index: > > explain analyze > select * > from search > where search_vec @@ to_tsquery_partial('213 E 13 S

Re: [GENERAL] cannot get stable function to use index

2015-12-29 Thread David G. Johnston
On Tue, Dec 29, 2015 at 4:13 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, Dec 29, 2015 at 3:52 PM, Andy Colson wrote: > >> ​[...]​ >> >> Originally it didn't have "STABLE STRICT", but I added it. Doesn't seem >> to matter though. I cannot get this sql to use the index: >

Re: [GENERAL] cannot get stable function to use index

2015-12-29 Thread Jim Nasby
On 12/29/15 5:21 PM, David G. Johnston wrote: STABLE functions, nor VOLATILE ones, are candidates for indexing. Only IMMUTABLE ones. The default for functions is VOLATILE.​ I haven't the time to provide a solution to your problem - I'm just pointing out "cannot get stable functi

Re: [GENERAL] efficient math vector operations on arrays

2015-12-29 Thread Jim Nasby
On 12/27/15 2:00 AM, Jony Cohen wrote: Hi, Don't know if it's exactly what you're looking for but the MADLib package has utility function for matrix and vector operations. see: http://doc.madlib.net/latest/group__grp__array.html Apply an operator to al elements on an array or pair of arrays: h

Re: [GENERAL] cannot get stable function to use index

2015-12-29 Thread Tom Lane
Andy Colson writes: > I cannot get this sql to use the index: > explain analyze > select * > from search > where search_vec @@ to_tsquery_partial('213 E 13 ST N') > -- > Seq Scan on search (cost=0.00..2526.56 rows=1 width=6

Re: [GENERAL] efficient math vector operations on arrays

2015-12-29 Thread Tom Lane
Jim Nasby writes: > BTW, if you want to simply apply a function to all elements in an array > there is an internal C function array_map that can do it. There's no SQL > interface to it, but it shouldn't be hard to add one. That wouldn't be useful for the example given originally, since it itera

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 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] efficient math vector operations on arrays

2015-12-29 Thread Jim Nasby
On 12/29/15 6:50 PM, Tom Lane wrote: Jim Nasby writes: >BTW, if you want to simply apply a function to all elements in an array >there is an internal C function array_map that can do it. There's no SQL >interface to it, but it shouldn't be hard to add one. That wouldn't be useful for the examp

Re: [GENERAL] Transfer db from one port to another

2015-12-29 Thread Killian Driscoll
On 24 December 2015 at 18:33, Adrian Klaver wrote: > On 12/24/2015 12:03 AM, Killian Driscoll wrote: > > >> >> yeah, this one from Adrian, at 7:02am PST (Z-0800) this >> morning >> >> Per previous posts you want, whenever possible, to us a >> newer version >>