Solved

Two TZQuery'ies connected via MasterSource

Posted on 2012-03-21
9
1,030 Views
Last Modified: 2012-03-21
Hello Experts!

I have to TZQuery components.

They are providing data from two Master- Detail tables.

It looks like this:

1.

select * from table1 where index = 1;

2.

select * from table2;

These two TZQuery are connected together via MasterSource, MasterFields, LinkedFields and IndexFieldNames.

It works fine but slowly.

I wonder if I could make it work faster...?

Maybe I should avoid queries like:

select * from table2?

What is the best practice to realize this master- detail connection?

Thank you

panJames
0
Comment
Question by:panJames
  • 7
  • 2
9 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37746930
to provide tuning solution, you'll need to indicate what database you are using
in general:
minimize your column list (only select columns you really want)
minimize your rows returned (do you actually read more than 25 lines ?)

for master-detail you can usually combine in 1 query

select
  m.column1 master_col1,
  m.column2 master_col2,
  m.column3 master_col3,
  d.column1 detail_col1,
  d.column2 detail_col2
from table1 m
  left join table2 d on m.mastercolumn = d.mastercolumn
where m.index = 1;

displaying the data in the detail view can be done by applying a filter on the data in memory
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37746938
when tuning a problem the basics should be checked too:
network > amount of data to copy
local pc > cpu load, memory,
database type > local, server, load
query > optimal execution path ?
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37746941
delphi is all about code
if you don't supply code, it's mainly guessing where your problem is
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:panJames
ID: 37746999
"minimize your rows returned (do you actually read more than 25 lines ?)"

how do you make your query return only lets say maximum 25 lines?

Thank you

panJames
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37747003
database type ?
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37747027
mysql
select columns from table LIMIT 1, 25

oracle
select columns from table where rownum <= 25
> doesn't have a offset

in the properties of some query components you can find this:
FethAll: boolean; (default false)
FetchCount: 25; (default)

some grids like devexpress know this and can call FetchNext to get all data
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37747072
Zeos lib components don't have this functionality
you'll have to use other components or do it with sql
0
 

Author Comment

by:panJames
ID: 37747079
Firebird
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 37747115
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Slow SQL query 12 61
VBA MS Word "Table of Contents" extractor` 4 41
AWS RDS Backups? 3 40
Slow Restore if incremental backups using RDiff.exe 4 19
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question