Re: [SQL] Index usage on date feild , differences in '>' and '>=' and between

2002-09-18 Thread Rajesh Kumar Mallah.
Thanks very much for the response. set enable_seqscan=off; Definitely helps. and for wide date ranges it usees indexes. But with default value of enable_sequence changing date range seems to have effect. can you explain me a bit more or point me to right documents for understanding the lan

Re: [SQL] Index usage on date feild , differences in '>' and '>='

2002-09-18 Thread Stephan Szabo
On Thu, 19 Sep 2002, Rajesh Kumar Mallah. wrote: > I am trying to improve a query to use existing indexes but facing diffculty. > > > Looks like 'between' amd '>=' are not using indexes althoug > and < does. > all my application code uses between and i am sure it use to work fine > at one point

[SQL] Index usage on date feild , differences in '>' and '>=' and between

2002-09-18 Thread Rajesh Kumar Mallah.
Hi , I am trying to improve a query to use existing indexes but facing diffculty. Looks like 'between' amd '>=' are not using indexes althoug > and < does. all my application code uses between and i am sure it use to work fine at one point of time. regds mallah. SQL TRANSCRIPT: ==

Re: [SQL] Performance w/ multiple WHERE clauses

2002-09-18 Thread Stephan Szabo
On Wed, 18 Sep 2002, Aaron Held wrote: > I am running into a serious performance issue with some basic queries. > > If I run something like > >select * from "Calls" WHERE > ( ("CallType" = 'LONG DIST' )) > > The search takes about 15 seconds > > if I run > select * from "C

[SQL] Performance w/ multiple WHERE clauses

2002-09-18 Thread Aaron Held
I am running into a serious performance issue with some basic queries. If I run something like select * from "Calls" WHERE ( ("CallType" = 'LONG DIST' )) The search takes about 15 seconds if I run select * from "Calls" WHERE ( ( "DateOfCall"='06/19/02') )

[SQL] Query to evaluate space used

2002-09-18 Thread Jeff Boes
This may or may not be original, but I cobbled it together and thought it might be useful: a query that reports how much space is used by each table in your database, including TOAST and TOAST-IDX tables. This particular version is a bit fancy because it shows the top 20 by space, followed by a

[SQL] TSQL2 (Temporal SQL) support for Postgres

2002-09-18 Thread Ewan Grantham
Is anyone aware of any projects that support the use of TSQL2 or similar functionality working with Postgres? TIA, Ewan Grantham ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] Creating a field that uses totals other fields?

2002-09-18 Thread Sloan Bowman
I am wanting to create a table that will sum up the total of an order and automatically put value in the specified field. An example of the table is below. Any ideas on how to do this. CREATE TABLE sales_info ( sales_id serial PRIMARY KEY, prod_id int REFERENCES product (prod_id), qty int, uni

Re: [SQL] Returning a reference to a cursor from a function

2002-09-18 Thread david williams
Thanks again Richard.   I did find that dev note and I do have a version of this working but of course it does not return up to the ASP layer.   Since I need to integrate Postgresql ( or something else ) into an existing application using COM as the middle and ASP as the upper layer I must create a

Re: [SQL] Returning a reference to a cursor from a function

2002-09-18 Thread Richard Huxton
On Tuesday 17 Sep 2002 7:12 pm, you wrote: > Richard, > > Thanks for the information. I've made some modifications to your code here > so that it does a RAISE NOTICE in each loop returning simply the value of n > and then when the loop is finished it again returns n. > > This works fine at the psq