Fw: How to FindNearest

Поиск
Список
Период
Сортировка
От paallen@attglobal.net
Тема Fw: How to FindNearest
Дата
Msg-id 621614386-1159896983-cardhu_blackberry.rim.net-1477550429-@bxe017-cell01.bisx.prod.on.blackberry
обсуждение исходный текст
Ответы Re: Fw: How to FindNearest  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
I guess I explained that very poorly.  Sorry.  It is actually much simplier.

I have 3 tables

Hole Hole_id X Y Z

Down_hole_survey Hole_id Depth_meters Azimuth Vertical_inclination X Y Z

Sample Hole_id Depth_meters X Y Z

Hole_id is a primary key in the hole table while it is a foriegn key in down_hole_survey and sample tables.

My function will take all the above info about the hole and down_hole_survey tables, and sample.hole_id and
sample.depth_metersand will calculate the coordinates.  I need to put these coordinates into sample.x , sample.y and
sample.z.
 

What I used to do was have one function that would return 3 values (x,y,z).  Then create 3 more functions that would
callcall the main function and pull out the 3 values seperately to update the 3 seperate columns.  It works fine but I
haveto call the main function 3 times which produces a slow performance.
 

I hope that I explained it better this time.

Phil
Sent via BlackBerry from Cingular Wireless  

-----Original Message-----
From: Bruno Wolff III <bruno@wolff.to>
Date: Tue, 3 Oct 2006 12:11:25 
To:Alexander Ilyin <a_ilyin@ukr.net>
Cc:pgsql-sql@postgresql.org
Subject: Re: [SQL] How to FindNearest

On Tue, Oct 03, 2006 at 14:43:40 +0300, Alexander Ilyin <a_ilyin@ukr.net> wrote:
> 
> Thank you for your great idea. But how it can be used for positioning the cursor in the already existed ResultSet?
Usingyour idea I can found the closest to targetvalue row but not its position in my ResultSet.
 

You wouldn't be able to use it to position a cursor. But if you aren't
retrieving a lot of records at once, this may still be a workable strategy
for you.

> Anyway thank you for your idea it is very useful by itself. Also I can solve my problem using your idea and emulating
themovement in my existed ResultSet. Even better - no need to store the large RS between cursor movements. Just each
timeI need to fetch the all visible rows.
 

That sounds pretty reasonable.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
              http://archives.postgresql.org

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Worky Workerson"
Дата:
Сообщение: Updating from table with multiple possibilities
Следующее
От: chester c young
Дата:
Сообщение: timestamps over the web - suggestions