Click here to Skip to main content
15,912,400 members
Home / Discussions / Database
   

Database

 
QuestionDebugging Postgresql plpgsql [modified] Pin
Jacobus016-Aug-09 23:38
Jacobus016-Aug-09 23:38 
QuestionHelp with optimization for searching a data table for a logical 'AND' Pin
Spacix One6-Aug-09 18:03
Spacix One6-Aug-09 18:03 
AnswerRe: Help with optimization for searching a data table for a logical 'AND' Pin
N a v a n e e t h6-Aug-09 19:07
N a v a n e e t h6-Aug-09 19:07 
GeneralRe: Help with optimization for searching a data table for a logical 'AND' Pin
Spacix One7-Aug-09 2:32
Spacix One7-Aug-09 2:32 
AnswerRe: Help with optimization for searching a data table for a logical 'AND' Pin
i.j.russell6-Aug-09 21:33
i.j.russell6-Aug-09 21:33 
GeneralRe: Help with optimization for searching a data table for a logical 'AND' Pin
Spacix One7-Aug-09 2:36
Spacix One7-Aug-09 2:36 
QuestionRe: Help with optimization for searching a data table for a logical 'AND' Pin
Spacix One7-Aug-09 2:24
Spacix One7-Aug-09 2:24 
AnswerRe: Help with optimization for searching a data table for a logical 'AND' Pin
David Skelly7-Aug-09 2:37
David Skelly7-Aug-09 2:37 
I'm a bit unclear what you're looking for here. What do you mean by "every value with the same record_id"?

The solutions posted by the others will give you a list of record_ids that have entries in the table for either (type = 1002 and value > 20) OR (type = 1003 and value > 40).

The solution that you posted would give you a list of record_ids that have entries in the table for both (type = 1002 and value > 20) AND (type = 1003 and value > 40).

These are not the same thing, so which one are you looking for?

In terms of your original question, this is probably no help since you do not have control over the table, but one obvious question is: is there an index over parm_type? Without an index over this column, the DBMS is going to end up doing a full table scan which will take a long time on a big table (i.e. it will simply look at every row in the table in turn to see if it matches the query).
GeneralRe: Help with optimization for searching a data table for a logical 'AND' Pin
Spacix One7-Aug-09 2:49
Spacix One7-Aug-09 2:49 
NewsRe: Help with optimization for searching a data table for a logical 'AND' Pin
Spacix One7-Aug-09 3:07
Spacix One7-Aug-09 3:07 
QuestionQuery a DB for a field value on SQL 2005 STD SP2 Pin
Hulicat6-Aug-09 7:43
Hulicat6-Aug-09 7:43 
AnswerRe: Query a DB for a field value on SQL 2005 STD SP2 Pin
David Mujica6-Aug-09 8:06
David Mujica6-Aug-09 8:06 
GeneralRe: Query a DB for a field value on SQL 2005 STD SP2 Pin
Hulicat6-Aug-09 8:22
Hulicat6-Aug-09 8:22 
Questionproblem with creating view? Pin
shankbond6-Aug-09 2:45
shankbond6-Aug-09 2:45 
AnswerRe: problem with creating view? Pin
Ashfield6-Aug-09 8:57
Ashfield6-Aug-09 8:57 
Questionhow to check " is not null condition" in a field of single select query Pin
anushh6-Aug-09 0:45
anushh6-Aug-09 0:45 
AnswerRe: how to check " is not null condition" in a field of single select query Pin
WoutL6-Aug-09 1:21
WoutL6-Aug-09 1:21 
GeneralRe: how to check " is not null condition" in a field of single select query Pin
anushh6-Aug-09 2:24
anushh6-Aug-09 2:24 
GeneralRe: how to check " is not null condition" in a field of single select query Pin
WoutL6-Aug-09 3:07
WoutL6-Aug-09 3:07 
GeneralRe: how to check " is not null condition" in a field of single select query Pin
Blue_Boy6-Aug-09 3:41
Blue_Boy6-Aug-09 3:41 
QuestionNeed Help,METHOD of COLD BACKUP AND RESTORE COLD BACKUP ORACLE 10G Pin
M Riaz Bashir5-Aug-09 20:08
M Riaz Bashir5-Aug-09 20:08 
AnswerRe: Need Help,METHOD of COLD BACKUP AND RESTORE COLD BACKUP ORACLE 10G Pin
Mycroft Holmes5-Aug-09 22:10
professionalMycroft Holmes5-Aug-09 22:10 
QuestionSQL server not starting Pin
User 61271795-Aug-09 5:52
User 61271795-Aug-09 5:52 
AnswerRe: SQL server not starting Pin
Byron70705-Aug-09 16:46
Byron70705-Aug-09 16:46 
AnswerRe: SQL server not starting Pin
phoenixR7726-Nov-09 3:46
phoenixR7726-Nov-09 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.