similar to: help, queries in each page

Displaying 20 results from an estimated 200000 matches similar to: "help, queries in each page"

2008 Apr 22
2
Custom Mysql queries slower than ActiveRecord in production
I have been working on optimizing the performance of a Rails app by rewriting the AR record methods into custom sql queries. What I did is that the result from the query is not instantiated as an object, which is supposed to be too time consuming. Here are the performance difference between using default AR methods and its custom equivalent. The number of requests per second was read from the log
2007 Apr 04
1
[PLUGIN] count_from_query - easily convert finder queries into count queries
count_from_query gives you the ability to generate a COUNT query from a standard Rails find. For example, if you have the query User.find :all it would be trivial to get a count: User.count however, if you have a more specific finder method, such as class Company < ActiveRecord::Base def complete_videos Video.find :all, :conditions => "company_id=#{id} AND
2008 May 16
1
Sql queries in rails
I have an assignment and I need to be able to run a query inputted by the user (no matter what the query). Also I need to display the result cleanly with the field names if the query was a select query. So far I have @result = ActiveRecord::Base.connection.execute(params[:query]) and in my view I have <% for result in @result %> <%= result %> <% end %> but this returns all
2007 Aug 15
1
can someone explain sql server performance differences?
Friends, I was wondering if any Rails/SQL Server experts could offer some help in regards to a question I had. Lately I have been getting some "timeout expired" errors in rails for some of my find_by_sql queries. When I load these pages, they often take upwards of 2-4 minutes and eventually they throw a timeout exception. When I run the exact same query in SQL Enterprise Manager, the
2008 Jun 20
0
Queries in development log using ODBC adapter
Hi all. I''m in a project right now where I''m using the ODBC adapter to connect to a MS Sqlserver DB (believe me, it''s not my choice). Is there any way to get the SQL queries being generated a la the log when using MySql? Thanks, Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2008 Dec 26
0
How to execute multiple queries in one report of iReports?
Hi All, Can anyone tell me how to execute multiple queries in one report of iReports? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To
2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
The built-in Rails pagination is fairly limited...you pass in the model name, and optionally some conditions, and it generates a paginated query for you. This gets to be very bad if you''ve got any custom queries. class Company < ActiveRecord::Base def complete_videos Video.find :all, :conditions => "company_id=#{id} AND status=''complete''", :order
2008 Jan 10
0
BUG? has_many :through makes funny queries
So I have this structure. class Gallery < ActiveRecord::Base belongs_to :owner, :polymorphic => true has_many :folders, :order => ''slug'', :dependent => :destroy class Folder < ActiveRecord::Base has_many :photos, :dependent => :destroy, :conditions => "parent_id IS NULL" belongs_to :gallery class User < ActiveRecord::Base has_one
2007 Feb 18
2
help with an error with tinymce (installation)
hi, i''m trying to install tinymce following the wiki, so i''ve done svn propedit svn:externals vendor/plugins into the tmp saved tiny_mce <a href="https://secure.near-time.com/svn/plugins/trunk/tiny_mce">https://secure.near-time.com/svn/plugins/trunk/tiny_mce</a> but it say this $ svn propedit svn:externals vendor/plugins svn: Error parsing svn:externals
2008 Apr 10
3
New to ruby, Need help
I''m attempting to make a simple program, just combine two images and output a .jpg file. Here''s what I have: class PicController < ApplicationController require ''RMagick'' def index im1 = Magick::Image.read(''1.jpg'') {self.size = "81x81"}.first im2 = Magick::Image.read(''2-1.jpg'').first result = im1.composite(im2,
2008 Apr 16
3
Linking to "Next Entry >>" from the current Entry Page
Hi all, I''m trying to link to the "Next Entry >>" from the current entry page (in show.html.erb). Any one know how I would do it? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2008 Jun 13
2
Rails 2.1.0 - find with :include and missing JOIN in SQL query
Hi, We''re trying to rewrite veeeery old Rails app that we successfully managed to move to 1.2.6 and now we''re trying with 2.1.0. One of the problems is caused by :include in AR.find. Rails 1.2.6 generates totally different SQL query than 2.1.0. Here''s Rails find query and generated SQL queries: Foo.find(:all, :include => :ticket, :conditions =>
2008 Nov 03
17
SQL queries in Rails
Hi... I want to know the equivalent instructions to insert, update, search and delete a registry. I know Rails can do it easily Thanks to ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using SQL to do the migration (Including the foreign keys), I need to know if I can use SQL queries to do those actions. Is there an example out there? I uncommented
2009 Mar 12
5
InvalidAuthenticityToken from home page
I''m trying to create a log in in index.html, but I keep getting an error about InvalidAuthenticityToken. I understand this is something that RoR puts in the forms, and it changes regularly. The problem is that the home page in the public folder is html, and therefore static. has anyone else put a log in on their home page? -- Posted via http://www.ruby-forum.com/.
2008 Feb 04
1
How does craigslist retain search query results?
When you search for a keyword on craigslist, a list of posts is returned. When you click on an individual post in that list, the full post is displayed. Then, when you press the back button on your browser, the results list is displayed again, without the server having to query again for the list of keywords. How can I get the server to remember search results without having to requery the
2008 Apr 08
0
Help building view to pass query to controller
I am very new to programming and would like to configure the following: I want to configure a page that displayes some graphs. These graphs pull its data from a sql table. What I would like to do is configure a view .erb to have a search field that will take text and inject it to part of a pre-configured sql query I have setup in a model. I will try to explain as best I can with code.
2008 Jan 01
2
un cache a page
how do i un-cache a page? i updated my application, and every works but the cached pages. for the cached pages, the old pages appear. thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2007 Apr 09
1
help with ActiveRecord joins
I''m working on a fairly complex join query and could use a bit of advice from more expert users of ActiveRecord. I have an events table with quite a lot of data, with has_many relations to categories, age_groups, and event_images. In my first naive implementation, each event had a date, so to load all upcoming events efficiently, I''d do: Event.find(:all,
2006 Sep 27
0
ActiveResource and query string parameters
I have an app that was built using the new RESTful methods and I''m trying to access its resources from another app using ActiveResource. (more about the app itself on my blog -- http://jystewart.net/process ) The app provides details of bus stops in Grand Rapids, Michigan, and the index method for the stops resource allows users to specify a point (using its longitude and
2008 Dec 05
1
page views counter
Hi all, I''ve made a really simple page views counter. def show @post = Post.find...... addcount = @post.views += 1 @post.update_attribute "views", addcount end Its working fine, but if someone hold the F5 key, it keeps counting and counting. Which is not a really good. Is there a way how to force the counter to not keep counting while someone is holding the F5 key? THX