Performance Of Views
I have a large table in a database that takes a long time to do any queries on. All user queries on this table are done as part of a background process at the moment.
The table holds transaction information from organisation and account id's; each organisation may have more than one account id. This table contains the raw transaction data, so there are many 1000's of records for each id. The table is keyed on customer number, which is different from organisation id and one customer number may have more than one organisation id. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Performance Improvement With Views?
If we have an option of using view to static assignment of options which one should we go for? Like if we have a combo box which is gonna have lets say 5 options then should we assign these options statically or should we store them in a view and then retrieve them dynamically each time someone clicks on the drop box.
View Replies !
Large Table Performance Problem With MYSQL Performance
I am doing some benchmarking of an application using MYSQL under Windows and I confused about the results. Environment Emachine 6417 with amd3200+ 64 bit processor 3.3GB ram mysql 4.1 with odbc 3.51 MYISAM windows 2003 server std edition date, account and invoice number are indexed Database size 18 million rows I am querying (selecting) columns of a date and an account our tester program that opens a socket to the Mysql database and does a select for the above n times each time the date and the account is randomized to minimize hits on records closeby. This program will perform over 1000 queries per second. At the end, the Mysql socket will be closed Even when the socket is closed each time, I still get 400 queries per second. When I enter a similar query manually a web interface, I get about 3-9 second response time. This program opens/closes a socket for each query when using EMS I get similar 9 second results. Does anyone have any suggestions Also in production, this table will be accesse for both read and write will I have problems. My testing showed that Innodb is much slower.
View Replies !
Views In 5.01
We have just loaded 5.01 so that we can take advantage of views. One question I have before I start experimenting is this: Can you "view" across databases? And if the answer is yes, can you "view" across servers? Given two tables "company" and "people", each living in a different database (and potentially on different servers) can you give an example (the SQL) of how to link them in a view? assume the following: company ------- c_id c_name people ------ p_id p_name c_id
View Replies !
Views
I just wanted to post and let people know that I discovered views today and I love them! I have a really complicated query that has 6 tables joined to return only 11 columns. At present, with a small number of values to be displayed, the result was generated in 0.046 seconds. Using a view it took only 0.016 seconds. I didn't try it as a view for performance reasons I must admit, but rather because I wanted to try it out and the query I was writing was just over complicated to be using in PHP. The tables that are queried have over 250,000 records in total (a couple of 110,000 each and a few very small ones) so I thought that was a reasonable performance increase. I am curious however; as this is my first foray in to views, is there anything I should watch out for? Anything that may appear all shiny and great now but will bite me in the *** later on?
View Replies !
Delete Views
how to drop a view in Ms Access using ColdFusion.I don't think the problem is ColdFusion, i think the problem is the query but it might be anything.
View Replies !
Mysql Views
I have only ever developed database application using Mysql and so have limited experience of views and how they work. I'm sorry if this seems basic. Suppose I create a view from a table, say A and tranform it using a select query to create my view, B. If I want all the data from B, ie. SELECT * FROM B will the DBMS need to go back to the original data and execute the query that generated B and then return my results - or - does it store the data for view B in a table like format and then just quickly return that. Essentially is there a performance advantage when using a view where the transformation from table A to view B is complex.
View Replies !
Views And MyODBC
well i just installed MySQL "5.0.1-alpha-nt-max" to play around with the new Features on my local PC.reating and accessing Views seems to work, but as it seems MyODBC 3.51.09 cant handle Views. Are there any plans to support Views also via MyODBC ? If so, is that Feature currently in the Bitkeeper-Repository of "MySQL Connector/ODBC 3.52" ?
View Replies !
Views In MySQL
I want to migrate my existing SQL Server database to MySQL. It had many views in it. When i tried to make views in MySQL 5.0, it gives error. I was suggested by this forum that views can be created in MySQL version 5.0.1, but i couldn't download it from anywhere. From where can i get it? I tried to download from mysql.com file named "mysql-5.0.1-alpha-snapshot-win.zip". This downloaded file gives me 5.0.0-alpha-nt server and 5.0.1-alpha client. This version is also not allowing me to create a view.
View Replies !
As Views Really Supported
With MySQL 5 beta and InnoDB tables, are views really supported? I can see the syntax in the manual but I get syntax errors on even a trivial attempt to define a view as in create view foo as select * from project produces You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'view foo as select * from project' at line 1
View Replies !
Views, Procedures
I have version 4.0.12 of MySql installed. I can not create views and stored procedures. Is this normal or is there something wrong in the installation?
View Replies !
Views In MySQL 4.1
Is it possible to create views in MySQL 4.1 or am I just wasting my time trying to figure out the syntax? I've tried searching this site but can't find anything about it for 4.1.
View Replies !
Views In Phpmyadmin
I created a veiw in phpmyadmin How can I modify it? when i click on structure instead of seeing the view I see it as if it was a table with fields.
View Replies !
Views In MySql/PHP
This thread is answering a question from [url=http://www.codingforums.com/showthread.php?s=&threadid=12528[/url]this thread] -- I didn't want to distract from the original question. To recap:A view is a virtual table. It is a stored query, usually based on two or more tables. It can be used as a table by other queries (by default, all queries created in Access are, in fact, views). The main advantages are efficiency and security. You can merge complex tables that store complete information to produce more simple tables that contain live information without any data duplication. You can also give the view query different access, meaning that you can let people see only some columns of a table (eg a view restrict who can see creditcard numbers, without restricting who can see other customer details). They are not supported in mySql. Followed by: what is the alternative to 'view' in mySQL/PHP then ... The simple answer is there is no alternative. You can easily enough create a database layer that stores queries in php. But, if the user has access to run these queries on the underlying tables, then they also have access to bypass them. You can also, with a little effort, create a method for building queries from SQL (this is a fairly standard way of operating a large system). However, you do not get the dabase level security benefits that you get from using views. Nor do you get the performance benefits that you get from views (I don't know all the details, but a view does run faster than a regular sql query). You can use a degree of database level security -- by limiting access to tables using GRANT statements. With views, you can use database security to completely limit access to rows, columns, and calculated fields without any data duplication. Of course, it is possible to implement application level securty in PHP, but the dual (or more often treble) layer of security is quite useful when you're dealing with complex two and three tier systems.
View Replies !
Views Overhead
Not far long ago, I was posting a question about performance of database with a lot of tables. Now I have a good idea towards moving to a shared tables approach, so there will be only one set of tables for all users, but each of the users will have an own set of views like: create view username_posts as select id, title from posts where user_id = user_id It would make database more efficient, and would need only a small set of changes to the application. What do you think about this approach? Is there a huge overhead of using views like the one mentioned above, in comparison with adding the user_id = ... clause to the application? How well does MySQL (InnoDB) behave in case database has a lot of views?
View Replies !
Views In MySQL 5.x
Was wondering if anyone here has had any experience with views in mysql 5? I know what they are and how to use them, was just wondering if anyone here has before and if they feel it is better, in mysql, to just create the new table or use the view instead? Or perhaps a complex join?
View Replies !
Question About VIEWS
I have never used MySQL views before, however, in my current situation I will sooner or later need to use them. I have one table which consists of sent messages and another which consists of recieved messages. When someone sends a message to another person, the message will be stored in their own sent messages. However, when they recieve a reply from the end user, the message will appear as a conversation as apart of their own inbox. So basically, the query which requests the inbox records will fetch both the sent and recieved message records. So I need to use a view to fetch both messages, how do I do this? If you guys are still wondering what I am talking about, then check out FaceBook's private messaging system.
View Replies !
Views Tutorial?
This tutorial explains what VIEWS are and how are they created. My Question is that why do we need VIEWS for? Why cannot we use the normal SELECT command and fetch records directly from the main table instead of creating a VIEW first and then display records?
View Replies !
Views Support In 5.0.0-alpha
from 1.8.5.6 Views: "Views are currently being implemented, and will appear in the 5.0 or 5.1 version of MySQL Server." i see the stored functions/procedures being added to the 5.0.0-alpha release but i do not see any support for views still. are they going to appear later in 5.0 or we would have to wait till 5.1 ?
View Replies !
Keeping Number Of Views To Max. How?
I've got a "smallint(3)" to track the number of views of an article, it is updated width "SET views=(views+1)". What I'm just wondering is if when the article reaches 999 views, the next view will set it to 100(0) or will just remain with 999. I think it will go on counting so, how can I just leave it with 999 views?
View Replies !
Stored Procedure Vs Views
I am a little confused on the benefits of views when compared to stored procedures. When should you use a view and when should you use a stored procedure? Do either technology have a performance edge over the other?
View Replies !
Views And Altering Base Tables
I want a view that contains all the colums of the base table but only the rows where the index "owner" is a certain value. Easy enough CREATE VIEW bt_42 AS SELECT * FROM bt WHERE owner=42 This seems to me to be easier, quicker, and more maintainable than enumerating each column and it seems to work. Now the question is if I happen to add another column to bt will that automatically be reflected in all views that were made by SELECT * ? Seems like it should, since updates to other columns of bt would be reflected in bt_42
View Replies !
VIEWS,CHECK SYNTAX AND FOREIGN KEY
i am trying to see what views i have created on my database and am lost with the code part. this is what i have tried in both the USE DATABASE, USE INFORMATION_SCHEMA SHOW VIEWS; SHOW CREATE VIEW; SHOW CREATE VIEWS; ANYONE GOT ANY HELP? I am also trying to use check and it doesn't seem to work. I am trying to 'ensure the only values entered into the GENRE table are dance, pop and jazz. I had been trying with this: CHECK(GENRE IN('DANCE','POP','JAZZ') how do i add ORDER_NUM as a foreign key in a table called ORDER_LINE? i tried this: ALTER TABLE ORDER_LINE ASS FOREIGN KEY(ORDER_NUM) REFERENCES CUSTOMER;
View Replies !
Slow Join On Otherwise Fast Views?
select * from vw_fielddata takes 16ms to return just four rows, why does select * from vw_fielddata firstname join vw_fielddata secondname on secondname.AccountID = firstname.AccountID take over an hour? The views themselves contain joins on tables and further views, and although AccountID isn't a primary key from the tables it's gathered from it is a foreign key in them (I assume this makes it indexed?).
View Replies !
Using Views In A Fairly High Demant Environment
I am making a forum type system in which the only interface to the database is through stored procedures. Thats not the point though. I have run into a minor problem with my system that could be rectified if my request for the threads in a forum was drawn from a "view" table. Would a view be quite a burden on the systems performance if used in a situation like that?
View Replies !
Keeping Track Of Post Views Every Day (Table Structure)
I was thinking of having a table to keep track of post count every day. For example, i have the following table structure: CREATE TABLE `wp_views` ( `post_id` bigint(20) NOT NULL, `year` tinyint(4) NOT NULL, `month` tinyint(2) NOT NULL, `month_hits` int(7) NOT NULL default Ɔ', `day_1` int(6) NOT NULL default Ɔ', `day_2` int(6) NOT NULL default Ɔ', `day_3` int(6) NOT NULL default Ɔ', `day_4` int(6) NOT NULL default Ɔ', `day_5` int(6) NOT NULL default Ɔ', `day_6` int(6) NOT NULL default Ɔ', `day_7` int(6) NOT NULL default Ɔ', `day_8` int(6) NOT NULL default Ɔ', `day_9` int(6) NOT NULL default Ɔ', `day_10` int(6) NOT NULL default Ɔ', `day_11` int(6) NOT NULL default Ɔ', `day_12` int(6) NOT NULL default Ɔ', `day_13` int(6) NOT NULL default Ɔ', `day_14` int(6) NOT NULL default Ɔ', `day_15` int(6) NOT NULL default Ɔ', `day_16` int(6) NOT NULL default Ɔ', `day_17` int(6) NOT NULL default Ɔ', `day_18` int(6) NOT NULL default Ɔ', `day_19` int(6) NOT NULL default Ɔ', `day_20` int(6) NOT NULL default Ɔ', `day_21` int(6) NOT NULL default Ɔ', `day_22` int(6) NOT NULL default Ɔ', `day_23` int(6) NOT NULL default Ɔ', `day_24` int(6) NOT NULL default Ɔ', `day_25` int(6) NOT NULL default Ɔ', `day_26` int(6) NOT NULL default Ɔ', `day_27` int(6) NOT NULL default Ɔ', `day_28` int(6) NOT NULL default Ɔ', `day_29` int(6) NOT NULL default Ɔ', `day_30` int(6) NOT NULL default Ɔ', `day_31` int(6) NOT NULL default Ɔ', UNIQUE KEY `post_id` (`post_id`), UNIQUE KEY `year` (`year`), UNIQUE KEY `month` (`month`) ) Let say, today is the 20th July 2007, so my insert query will be like INSERT INTO wp_views (post_id, year, month, month_hits) VALUES (1, 2007, 7, 1) ON DUPLICATE KEY UPDATE month_hits += 1, day_20 +=1; Is my table structure alright? or is there a more efficient way of doing this?
View Replies !
Slow Queries When Using Views Compare To Direct Table Queries
I’ve having problems with my server load for a while now. I have two tables with different content, but I need to display them in the same results, so I created a view with a union all (named: top_news_videos). The problem that I’m seeing is that when running a select to the view it takes a lot longer (and in that way, more server intensive) than running the query directly to one of the tables. For example, I created a page where I run 7 queries similar to this one: MySQL Code: ...
View Replies !
IO Performance
I'm running a 5.0.51a mysql server on pentium M. My application is made of 30 myisam tables written every 2 seconds and a very few reads (1 evry hour) from the whole table. Each table is a kind of circular buffer (fixed number of line, current line). Each line of a table contains a medium blob whith fixed size (about 70k). I know the average output (Kb/sec) from the client to th server, says 200 Kb/sec. When trying to measure this flow with 2 invocations of "show global status like '%Bytes%'; followed by division by the elapsed time, I find between 1 and 2 times more (400 Kb/s). When I measure the output to the disk with the iostat command (iostat -d -k 10) I find 4 times more (800 Kb/s) and a lot of read Kb/s (100 kB/s). Is this normal or is there some tunning to do ? During this time, the iowait rate is very high (30%). Is this normal or is there some tunning to do ?
View Replies !
Best For Performance
It's a web application, accessed via internet, with around 100.000 clients and each client have around 10 users. This web app have a database of around 100 tables. Ok, the question is: Is it better to have each client with it's own catalog on the database (each catalog with around 100 tables) or is it better to use one catalog for all the clients (the tables would have a lot more records this way, but only one catalog)? I'm considering performance.
View Replies !
Which Is Better In Performance
country (id) country (1) America (2) Germany (3) Canada (4) China (5) Egypt (6) Russia (7) Korea (8) France (9) Brazil city (id) city (1) Berlin (2) New York (3) Cairo (4) Paris (5) Seoul (6) Peking (7) Chicago (8) Moscow (9) Denver I have two tables like the above. And I have one of these tables below. message1 (id) (city) message (1) (2) I love New York. (2) (5) Kumkang mountains are beautiful. (3) (4) I was born in France. (4) (6) Great Wall is great. (5) (7) Chicago is a big city. message2 (id) (city) (country) message (1) (2) (1) I love New York. (2) (5) (7) Kumkang mountains are beautiful. (3) (4) (8) I was born in France. (4) (6) (4) Great Wall is great. (5) (7) (1) Chicago is a big city. code1 select city, country from message1 left join city on city.id=message1.city left join country on country.id=city.country code2 select city, country from message2 left join city on city.id=message2.city left join ccountry on country.id=message2.country I think The codes above have a same result.(sorry, I didn't test it.)
View Replies !
Performance Of LIKE
I'm weighing the performance of materialised path vs. nested set algorithms, for storing a tree structure. The tree will have a lot of searches, a fair amount of inserts, but probably fairly few move-operations. The decisive factor seems to be the speed of a LIKE-query. I know, that regular expressions perform pretty well, as long as they are anchored. From this, I deduct, that LIKE must be able to perform equally good, since a path is indeed anchored. The questions is, if a LIKE will always result in a full scan, or if it can utilise indices? If it doesn't allow use of indices, would it be worth it, to use an equality comparison, on a substring (Which is essentially, what I'll be querying for) or am I just entirely missing the point?
View Replies !
Innodb Performance (CPU, RAM)?
I have a table with approx. 150,000,000 ++ rows. It should be approx 80 byte for each row. Now I'm planning to use it with mysql/innodb. Can you guys suggest anything about this. I have many questions... Can Innodb work well with such tables? Will queries (select/update) be slow? What hardware do you suggest, cpu/ram?
View Replies !
Balance Performance
My computer is AMD athlon 64 3400+ with 1.5G DDR. when i execute the following sql in mysql 5.XX. select c.filename, c.topic from articles c where c.topic in (select a.topic from articles a group by a.topic having count(a.topic)>1) order by topic; It eat up all the cpu power , and the mysql server stop responsing until end of this query. Even my apache stop responing too. How to fix this? How can i set the CPU limit of each query connection?
View Replies !
Performance MySQL With ADO VB
I'm developing an VB application which uses the SAX parser and ADO VB to insert.update data in in MySQL. The perormance is very bad. If I use the same data and insert/update to a MS Access database it takes 14 minutes. But using MySQL it takes about 5 hours! Here's the piece of code which takes the most time. Does anyone have an explanation for this? Code:
View Replies !
MySQL Performance
We ran MySQL (4.0.15-standard, 64-bit, SuSe 8.0) benchmarks on 2 CPU and 4 CPU Opteron machines. Mostly we tested insertion times with many simultaneous connections (hundreds). To our surprise we did not find significant differences.Each of our servers (2 and 4 CPU machine) has one 1Gbit network connection. I have feelings that the machines are the network bounded, not the CPU bounded. Could it be true? How to verify it?
View Replies !
Mysqlcheck Performance
I launch the command line: "mysqlcheck --repair dbname" over a database with only one myisam table of more than 10.000.000 rows and 5 GB. The elapsed time to repair is about 1 hour! Is possible to increase speed?
View Replies !
Low Performance With Linux SMP
I use #mysql -V mysql Ver 12.21 Distrib 4.0.15, for suse linux (i686) with a SMP-kernel When I used this version with a kernel not SMP mysql was very very fast but now with the SMP-kernel the mysql is very very slow. I takes several minutes to make an INSERT on a table with near 50.000 Records Is there any problem with mysql an SMP? is a problem of the version I have installed?
View Replies !
|