[HACKERS] Implementing a join algorithm in Postgres

2015-03-27 Thread Ravi Kiran
Hi,

I have written a C program which reads from 3 files(Each file is table
having 2 columns and thousands of rows).The program is used to join those 3
tables and the algorithm which I have written will work only for those 3
files. Now I want to test this program for postgres. Can someone tell me
how to do that, where should I include this program so that I can
successfully implement that program in postgres.

Thank you.

-- 
Regards,

K.Ravikiran

ᐧ


Re: [HACKERS] enabling nestedloop and disabling hashjon

2015-02-12 Thread Ravi Kiran
I am sorry for the late reply, when I  disabled the hash join command
enable_hashjoin=off in the postgresql.conf file, it was not working. But
I when I used the command set enable_hashjoin=off command in the back
end. It worked.
 I am not able to understand why it did not get disabled when I changed it
in the postgresql file.
ᐧ

On Fri, Feb 13, 2015 at 2:34 AM, Jim Nasby jim.na...@bluetreble.com wrote:

 On 2/10/15 9:29 AM, Tom Lane wrote:

 Ravi Kiran ravi.kolanp...@gmail.com writes:

 yes sir, I did try the pg_ctl reload command, but its still using the
 hash
 join algorithm and not the nested loop algorithm. I even restarted the
 server, even then its still using the hash join algorithm


 Does show enable_hashjoin say it's off?  If not, I think you must've
 fat-fingered the postgresql.conf change somehow.


 For future reference, posts like this belong on pgsql-performance.

 The other possibility is that the query estimates are so high that the
 setting doesn't matter. When you set any of the enable_* settings to off,
 all that really happens is the planner adds a cost of 10M to those nodes
 when it's planning. Normally that's enough to toss those plans out, but in
 extreme cases the cost estimates will still come up with the un-desired
 plan.

 Can you post EXPLAIN ANALYZE output with the setting on and off? Or at
 least plain EXLPAIN output.
 --
 Jim Nasby, Data Architect, Blue Treble Consulting
 Data in Trouble? Get it in Treble! http://BlueTreble.com



Re: [HACKERS] enabling nestedloop and disabling hashjon

2015-02-12 Thread Ravi Kiran
sorry for the inconvenience if caused to anyone, but as David G johnston
said, I was trying to change how the postgresql works and was not able to
figure out how it should be done. I will make sure it will be clear from
the next time. Thank you very much.

@Tom lane   Sir, I forgot to remove the # comment marker in the file's
entry, Thank you.
ᐧ

On Fri, Feb 13, 2015 at 2:50 AM, David G Johnston 
david.g.johns...@gmail.com wrote:

 Jim Nasby-5 wrote
  On 2/10/15 9:29 AM, Tom Lane wrote:
  Ravi Kiran lt;

  ravi.kolanpaka@

  gt; writes:
  yes sir, I did try the pg_ctl reload command, but its still using the
  hash
  join algorithm and not the nested loop algorithm. I even restarted the
  server, even then its still using the hash join algorithm
 
  Does show enable_hashjoin say it's off?  If not, I think you must've
  fat-fingered the postgresql.conf change somehow.
 
  For future reference, posts like this belong on pgsql-performance.


  but postgres is still using the hash join algorithm even after modifying
  the postgresql code

 To be fair given the original post, and some other recent posts by the same
 author, the question is not why is my query performing slowly but rather
 I'm trying to change how PostgreSQL works and cannot figure out how to
 properly enable and disable algorithms.  -hackers seems like the proper
 forum though the OP could give more context as to his overarching goals to
 make that more clear to readers.

 David J.




 --
 View this message in context:
 http://postgresql.nabble.com/enabling-nestedloop-and-disabling-hashjon-tp5837275p5837728.html
 Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.


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



Re: [HACKERS] enabling nestedloop and disabling hashjon

2015-02-10 Thread Ravi Kiran
yes sir, I did try the pg_ctl reload command, but its still using the hash
join algorithm and not the nested loop algorithm. I even restarted the
server, even then its still using the hash join algorithm

Thanks
ᐧ

On Tue, Feb 10, 2015 at 5:28 AM, Tom Lane t...@sss.pgh.pa.us wrote:

 Ravi Kiran ravi.kolanp...@gmail.com writes:
  I tried modifying the postgresql.conf file where I set the value
  enable_hashjoin=off and also enable_mergejoin=off, so that I could force
  postgres to use nested loop.
  but postgres is still using the hash join algorithm even after modifying
  the postgresql code.

 Did you remember pg_ctl reload?  enable_hashjoin=off will most certainly
 work if it's active.

 regards, tom lane



[HACKERS] enabling nestedloop and disabling hashjon

2015-02-09 Thread Ravi Kiran
Hi,


I want to disable the hashjoin algorithm used by postgres by default, and
enable the nested loop join algorithm, can some one tell me how to do that.

I tried modifying the postgresql.conf file where I set the value
enable_hashjoin=off and also enable_mergejoin=off, so that I could force
postgres to use nested loop.
but postgres is still using the hash join algorithm even after modifying
the postgresql code.

can some one tell me what I am doing wrong, or is there any other file
where I need to modify to enable nested loop join algorithm.

Thanks
ᐧ


[HACKERS] Hash Function

2015-01-11 Thread Ravi Kiran
Hi,

I want to know what kind of hash function postgres is using currently, can
someone please explain the algorithm postgres is using for the hash
function in the hash join algorithm.

Thanks,

K.Ravikiran


[HACKERS] NODE

2015-01-05 Thread Ravi Kiran
hi,

I am going through the hashjoin algorithm in postgres. I find a function
ExecHashjoin , which is called each time a new tuple is required by the
hash join *Node.*

could someone explain what exactly node mean in  postgres.

Thanks


[HACKERS] attaching a process in eclipse

2014-12-28 Thread Ravi Kiran
hi,

I am working with postgresql 9.4.0 source using eclipse(indigo version) in
ubuntu 14.04. I am facing a problem of attaching a client process to
postgresql server.

I am following the steps given in this link
https://wiki.postgresql.org/wiki/Working_with_Eclipse#Debugging_PostgreSQL_from_Eclipse

In the debug configuration , I have given the following information in the
fields.

C/C++ Application :- src/backend/postgres
Project :- postgresql-9.4.0

I have found out the process id of the client process using select
pg_backend_pid()  and used it to attach the server.

But I am getting the following error whenever I do this

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf

how do we rectify this error?

Thank you

Regards
K.Ravikiran


Re: [HACKERS] attaching a process in eclipse

2014-12-28 Thread Ravi Kiran
Sir, I followed the instructions in the link which you gave , but this time
I am getting the following error.

*Can't find a source file at
/build/buildd/eglibc-2.19/socket/../sysdeps/unix/sysv/linux/x86_64/recv.c *
*Locate the file or edit the source lookup path to include its location.*

is the error something related my OS or is it related to postgres.


Thank you for telling the mistake, I will follow the things which you told
from the next time.

Thank you

On Sun, Dec 28, 2014 at 7:36 PM, Craig Ringer cr...@2ndquadrant.com wrote:

 On 12/28/2014 07:49 PM, Ravi Kiran wrote:
  Thank you for the response sir, I am running both the eclipse and the
  client under the same user name which is ravi, I have installed postgres
  source code under the user ravi not postgres,

 It doesn't matter how you installed it. How you *run* it matters. If the
 postgresql processes run as user 'ravi' and so does Eclipse, then your
 problem is the one in the article I already sent you a link to, and you
 should follow those instructions.

  should I change it and
  work under postgres

 No. If you read my explanation you would understand that this would just
 make it worse, because you can't attach to a process under a different
 user id.

  and for that to happen should I uninstall the whole
  postgres and re install under the new user postgres.

 That won't help.

 By the way, it looks like you also posted this to Stack Overflow:

 http://stackoverflow.com/q/27676836/398670

 It's OK to do that, but *please mention you posted somewhere else too*
 or preferably link to the relevant article in the mailing list archives.

 Also, when replying to mail on a list, please reply-to-all.

 --
  Craig Ringer   http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training  Services



[HACKERS] mysql with postgres

2014-12-23 Thread Ravi Kiran
hi all,


Is postgres source code compatible with mysql database?? If it is, could
someone could give me some links so that I can do that.

I want to hack into the postgres source code, but as I am comfortable with
mysql, I want to use the mysql database not postgres.

any references would be fine.

thank you


[HACKERS] debugging with child process

2014-07-01 Thread Ravi Kiran
hi,

can any one help me with the 4th and 5th steps of the following link which
is to debug with a child process in postgres.

*https://wiki.postgresql.org/wiki/Working_with_Eclipse#Debugging_with_child_processes
https://wiki.postgresql.org/wiki/Working_with_Eclipse#Debugging_with_child_processes*


when I give the following fields in the debug configuration

*c/c++ Application : postgres*
*Project - psql*
*Build Configuration - Use Active*

I am getting the following error- * No source available for
__kernel_vsyscall() at 0xb726a424 *


Is there any better tool other than eclipse to use for editing or knowing
about source code in postgres.

Thank you