Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-11 Thread Amit kapila
On Saturday, January 12, 2013 7:17 AM T. E. Lawrence wrote: > Hello, > I have a pretty standard query with two tables: > SELECT table_a.id FROM table_a a, table_b b WHERE ... AND ... AND b.value=...; > With the last "AND b.value=..." the query is extremely slow (did not wait for > it to end, b

Re: [GENERAL] Getting Mysql data into Postgres: least painful methods?

2013-01-11 Thread John R Pierce
On 1/11/2013 3:54 PM, Ken Tanzer wrote: Here's the fuller description of what I'm trying to do. I've got a dataset (a UMLS//Metathesaurus subset) that I need to get into a Postgres database. It's all reference data, and so will be read-only. There's no functions or logic involved. I anticipa

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Rob Sargentg
On 01/11/2013 11:32 AM, Kirk Wythers wrote: On Jan 11, 2013, at 12:18 PM, Szymon Guz > wrote: On 11 January 2013 19:13, Kirk Wythers > wrote: Can anyone see what I'm misisng? I am trying to run a psql "copy from" command through

[GENERAL] reducing number of ANDs speeds up query

2013-01-11 Thread T. E. Lawrence
Hello, I have a pretty standard query with two tables: SELECT table_a.id FROM table_a a, table_b b WHERE ... AND ... AND b.value=...; With the last "AND b.value=..." the query is extremely slow (did not wait for it to end, but more than a minute), because the value column is not indexed (conta

Re: [GENERAL] Libpq and multithreading

2013-01-11 Thread Bruce Momjian
On Fri, Jan 11, 2013 at 04:27:42PM +0100, Asia wrote: > Hello, > > I am trying to use libpq in two threads, the issue is that I am getting > access violation after several successful connections. > Each thread connects to different db and disconnects immediately after making > a conenction. > >

Re: [GENERAL] Database connections seemingly hanging

2013-01-11 Thread Fredrik . HuitfeldtMadsen
Hi All, @ Tom Thank you for your response. While working on your suggestions, we seem to have found the cause of our problems. @ Yugo Thank you for your response. We are running pgpool in replication mode with load balancing enabled. If you have further questions to aid in debugging the situa

[GENERAL] Libpq and multithreading

2013-01-11 Thread Asia
Hello, I am trying to use libpq in two threads, the issue is that I am getting access violation after several successful connections. Each thread connects to different db and disconnects immediately after making a conenction. So my question is if this is supported by libpq? Is it possible to us

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Kirk Wythers
On Jan 11, 2013, at 12:18 PM, Szymon Guz wrote: > > > > On 11 January 2013 19:13, Kirk Wythers wrote: > Can anyone see what I'm misisng? I am trying to run a psql "copy from" > command through a bash script to load a buch of cdv files into the same > table. I'm getting an error about the f

Re: [GENERAL] Getting Mysql data into Postgres: least painful methods?

2013-01-11 Thread Rich Shepard
On Fri, 11 Jan 2013, Ken Tanzer wrote: I'm wondering if anyone can point me towards a good method for moving mysql data into Postgres? I had to do this last year with the ITIS (Integrated Taxonomic Information System) maintained by the US Geological Survey. Some MySQL key words were immed

Re: [GENERAL] Getting Mysql data into Postgres: least painful methods?

2013-01-11 Thread wd
You can search from google, https://www.google.com/search?q=mysql2pg&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a On Sat, Jan 12, 2013 at 7:54 AM, Ken Tanzer wrote: > I'm wondering if anyone can point me towards a good method for moving > mysql data into Postgres? I'v

Re: [GENERAL] Getting Mysql data into Postgres: least painful methods?

2013-01-11 Thread Adrian Klaver
On 01/11/2013 03:54 PM, Ken Tanzer wrote: > > > > but that didn't bring me much success. I figure this has to be a fairly > common need, and hopefully by 2013 there's an easy solution. Thanks in > advance! Have you looked at Foreign Data Wrappers(FDW): http://www.postgresql.org/docs/9.1/sta

[GENERAL] Getting Mysql data into Postgres: least painful methods?

2013-01-11 Thread Ken Tanzer
I'm wondering if anyone can point me towards a good method for moving mysql data into Postgres? I've done some web searching, and found documentation from various years, but it's not clear what's current and what works best. Much of what I found seems to be flame war material (why Postgres is bett

Re: [GENERAL] >

2013-01-11 Thread Gavin Flower
On 12/01/13 10:44, Gavan Schneider wrote: On Saturday, January 12, 2013 at 04:49, Gavin Flower wrote: On 12/01/13 06:45, Bosco Rama wrote: Shouldn't the value for theta be: 2 * pi() * random() Bosco. Very definitely! :-) One could also ask if the value for theta shouldn't be: tau() *

[GENERAL] >

2013-01-11 Thread Gavan Schneider
On Saturday, January 12, 2013 at 04:49, Gavin Flower wrote: On 12/01/13 06:45, Bosco Rama wrote: Shouldn't the value for theta be: 2 * pi() * random() Bosco. Very definitely! :-) One could also ask if the value for theta shouldn't be: tau() * random() :-) Regard

[GENERAL] changes "during checkpointing"

2013-01-11 Thread Sahagian, David
In regards to 9.1.x, I would like to learn some details of the nature of "checkpointing" === Question 1 === - page 123 is dirty - "checkpointing" starts - page 123 gets written to disk, as part of this checkpoint - page 123 gets modified again ? Does it get written to disk again, as part of

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Jerry Sievers
Kirk Wythers writes: > Can anyone see what I'm misisng? I am trying to run a psql "copy from" > command through a bash script to load a buch of cdv files into the same > table. I'm getting an error about the file "infile" not existing? > > #!/bin/sh > > for infile in /path_to_files/*.csv > do >

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Pavel Stehule
Hello >> >> Once more quickie. It seems that I am going to be asked for my password >> every time psql loops through the copy statement. >> >> What is considered best practices to handle authentication? I am >> connecting locally, as myself as the user and I'm being asked for my user >> password.

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Szymon Guz
On 11 January 2013 19:32, Kirk Wythers wrote: > > On Jan 11, 2013, at 12:18 PM, Szymon Guz wrote: > > > > > On 11 January 2013 19:13, Kirk Wythers wrote: > >> Can anyone see what I'm misisng? I am trying to run a psql "copy from" >> command through a bash script to load a buch of cdv files into

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Szymon Guz
On 11 January 2013 19:13, Kirk Wythers wrote: > Can anyone see what I'm misisng? I am trying to run a psql "copy from" > command through a bash script to load a buch of cdv files into the same > table. I'm getting an error about the file "infile" not existing? > > #!/bin/sh > > for infile in /pat

[GENERAL] psql copy from through bash

2013-01-11 Thread Kirk Wythers
Can anyone see what I'm misisng? I am trying to run a psql "copy from" command through a bash script to load a buch of cdv files into the same table. I'm getting an error about the file "infile" not existing? #!/bin/sh for infile in /path_to_files/*.csv do cat infile | psql dbname -c "\copy

Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-11 Thread Gavin Flower
On 12/01/13 06:45, Bosco Rama wrote: On 01/11/13 09:31, Gavin Flower wrote: -- theta in radians -- for radius = 100 INSERT INTO ranpoint (id, theta, r) VALUES (generate_series(1, 10), pi() * random(), 100 * random()); Shouldn't the value for theta be: 2 * pi() * random() Bos

Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-11 Thread Bosco Rama
On 01/11/13 09:31, Gavin Flower wrote: > -- theta in radians > -- for radius = 100 > > INSERT INTO ranpoint > (id, theta, r) > VALUES > (generate_series(1, 10), pi() * random(), 100 * random()); Shouldn't the value for theta be: 2 * pi() * random() Bosco. -- Sent via pgsql-gene