[SQL] Postgres 7.4 function

2007-08-29 Thread Radhika Sambamurti
Hi, I am using a function in postgres 7.4 that returns an integer. I modified my store procedure (same function and parameters) to point to another table, and return an int. But now I am not getting the correct answer only 0. I verified that the column I am returning is int in both the first tabl

[SQL] Bitmap Index Scan

2007-07-13 Thread Radhika Sambamurti
I am using Postgres 8.2.0. Is there a way to explicitly make the planner use bitmap index scan on a field? Thanks. Radhika -- It is all a matter of perspective. You choose your view by choosing where to stand. Larry Wall --- ---(end of broadcast)-

[SQL] Query Plan

2007-07-12 Thread Radhika Sambamurti
Hi, I have a complicated view joining 3 tables. Here are the run times: LOG: duration: 3380.672 ms statement: explain analyze SELECT * from vtradeblock where FirmClearingid = 'FIRMA' and status = 1; LOG: duration: 3784.152 ms statement: explain analyze SELECT * from vtradeblock where date_tr

Re: [SQL] using EXECUTE on Selects

2007-07-11 Thread Radhika Sambamurti
Thanks! That worked. I really could'nt make sense of the documentation, the way it was worded. I tested it out and it works. Thanks again! Radhika > am Wed, dem 11.07.2007, um 12:41:21 -0400 mailte Radhika Sambamurti > folgendes: >> Hi, >> >> Here is my need: &

[SQL] using EXECUTE on Selects

2007-07-11 Thread Radhika Sambamurti
Hi, Here is my need: I have to select data by building up the where clause: example: WHERE firm = 'nnn' WHERE firm = 'nnn' AND symbol = 'bbb' WHERE date BETWEEN 'startdate' AND 'enddate' AND symbol = 'bbb' And so on. I was hoping to write a function where I can build up my whe

[SQL] using EXECUTE on Selects

2007-07-11 Thread Radhika Sambamurti
Hi, Here is my need: I have to select data by building up the where clause: example: WHERE firm = 'nnn' WHERE firm = 'nnn' AND symbol = 'bbb' WHERE date BETWEEN 'startdate' AND 'enddate' AND symbol = 'bbb' And so on. I was hoping to write a function where I can build up my whe

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
> I believe the manual is quite clear on that one ( > http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-FLOAT) > : > > " - If you require exact storage and calculations (such as for monetary > amounts), use the numeric type instead." > > > So if you decide to use floats a

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
Andrew, This has been quite helpful. My main concern is CPU cost. Thanks for the input. --Radhika > On Tue, Apr 17, 2007 at 02:53:54PM -0400, Radhika Sambamurti wrote: >> that hold money fields and rates from varchar to float. I do not want to >> convert to numeric because numer

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
> > --- >> The question is: how accurate is floating point numbers in Postgres. We >> are using 7.4 soon to be moving to 8.2. >> I need the accuracy to about 6 decimal points. I have read that floating >> points can convert to numbers in accurately. > > http://www.postgresql.org/docs/8.2/interactiv

[SQL] Floating point type to store numbers

2007-04-17 Thread Radhika Sambamurti
Hi, I am currently using Postgresql to maintain an application which is used for trading and back office operations. Currently our monetary fields are stored in Varchar. I am finding a huge CPU utilization while converting from varchar to float. I think for reasons unknown to me, we originally stor

[SQL] Temp tbl Vs. View

2007-03-29 Thread Radhika Sambamurti
Hello, I have an interesing problem relating to sql and performance issues and am looking at ways I can increase the performace from postgres. Currently I have a view created from two tables. All the selects are being done on the view - which normally does not take a lot of time, but because my w

[SQL] View Vs. Table

2007-03-08 Thread Radhika Sambamurti
Hi, I have two tables which currently are being aggregated into a third table. I am proposing eliminating or drastically shortening the 3rd aggregation table, and instead just using a View. Which brings me to the question, which is better? Reading from a table or a view or is there a difference i

[SQL] [Fwd: View Vs. Table]

2007-03-06 Thread Radhika Sambamurti
Hi, I have two tables which currently are being aggregated into a third table. I am proposing eliminating or drastically shortening the 3rd aggregation table, and instead just using a View. Which brings me to the question, which is better? Reading from a table or a view or is there a difference i