[how to] COUNT of rows with parent id equal to the row we have with a parent id of 0 in one query [on hold] |
- COUNT of rows with parent id equal to the row we have with a parent id of 0 in one query [on hold]
- Help creating this query
- Inconsistent trigram indexing runtimes?
- How to use a database accross two availability zones
- Should I use a separate table to store image file names?
- SPI postgresql - insert data into table from postgres.c
- MariaDB CUstom Functions
- Error: "Storage Engine for the Table Doesn't Support Nullable Columns" (SequelPro)
- IN and NOT IN for XML column
- alter or recreate?
- 2NF relations of Normalization [on hold]
- Cassandra multidatacenter configuration with 1 external ip
- Dump PostgreSQL without DROP DATABASE
- optimizing MySQL for traffic analytics system
- SSIS organization
- LDAP in SQL Server 2012
- Percona Xtrabackup on Suse EL 10 -- Failing
- MySQL replication - slave update
- Fulltext search limiting users possibilities
- Having too many connection problem
- Primary replica set server goes secondary after secondary fails
- MySQL backup InnoDB
- Strange characters in mysqlbinlog output
- 12c Grid Agent installation issues - Shell path is incorrect or not defined
- How to increase fast backup and restore of 500GB database using mysqldump?
- Connecting to a SQL Server database from a Flash program
- Oracle Express edition on Ubuntu - control file missing
- How do I minimise logging during a large insert?
COUNT of rows with parent id equal to the row we have with a parent id of 0 in one query [on hold] Posted: 13 Jul 2013 09:00 PM PDT I'd like to do the following in one query:
How can I accomplish this in one query? Please let me know if you need more information, I will GLADLY be as assistive as I can Heres an example of what im doing now:
AND THEN
Thanks |
Posted: 13 Jul 2013 08:35 PM PDT I have the following tables in a MySQL Database: What I'd like to accomplish is one query that fetches the Currently, I have separated the query to obtain the This is one of the first posts Ive made on DBA Stack. I recognize its not complete. Please assist me in making this question better Thanks. |
Inconsistent trigram indexing runtimes? Posted: 13 Jul 2013 06:14 PM PDT I have a table I installed trgm: After adding trigram indexes to both And checking performance of a simple query... it appears that the total runtime for a query on the and For reference, both Futhermore... counting distinct values in each column yields:
That is, the More information on this technique can be found on depesz's article WAITING FOR 9.1 – FASTER LIKE/ILIKE and another similar tutorial on the PaliminoDB blog. |
How to use a database accross two availability zones Posted: 13 Jul 2013 06:07 PM PDT I have servers in the USA and Japan for my website, at the moment they are both connecting to a MySQL server in the USA, which is obviously perfect for my local USA clients, but quite slow for my Japanese clients. What is the best strategy for reducing latency? How can I introduce a local mysql server for the Japanese end and sync these up? I have considered master-master replication but this appears to be an incomplete and unstable solution. Are there any other suggestions? |
Should I use a separate table to store image file names? Posted: 13 Jul 2013 04:58 PM PDT I am learning about database design and I'm writing a Java GUI program with a back-end database. The main table in my database stores a different product in each row. I have some columns such as: product_id (PK), price, stock_quantity, etc. I also have eight columns that store the names of the file names for that product's images: img_file_1, img_file_2 ... img_file_8. The Java program uses those file names to find the images to display on the screen for that product. Is this poor design? Should I be storing these file names in their own table, and adding a foreign key to that table in my main table? The program works fine as is, but I want to make sure I am learning good habits. |
SPI postgresql - insert data into table from postgres.c Posted: 13 Jul 2013 04:45 PM PDT I'm working inside postgres.c of postgresql. I need to insert some information in a table and I'm trying to do it with SPI using these three lines: but when I start the server and I send a query I get segmentation fault: Do you have any idea how I can fix it? Is there a better way to insert data from the postgres.c? |
Posted: 13 Jul 2013 10:02 AM PDT In MySQL, I wrote functions in C++, compiled them as .so, and added them to MySQL. I am trying to find a website that shows an example for doing the same in MariaDB. I cannot find any instructions, tutorials, or examples of writing custom functions in MariaDB. Does anyone know of any or is anyone willing to write a very simple one here - like a md10 function that returns concat(md5(val),md5(val))? Just to make it clear - I am looking to write compiled code, not define a function in SQL. It isn't just for speed. We need to clone the boxes and have all MariaDB engines fully functional. |
Error: "Storage Engine for the Table Doesn't Support Nullable Columns" (SequelPro) Posted: 13 Jul 2013 01:20 PM PDT I'm trying to load a very normal .csv file (that was created from Excel 2011 for Mac) into SequelPro (using MySQL) with my Mac -- and I've recently started getting this error consistently. Can anybody let me know what it is and how to fix it? This is stopping me before I'm able to import the table. Thanks for the help! |
Posted: 13 Jul 2013 09:40 AM PDT I have a table with a xml column. Xml is similar to Now below query return sl_no column and myxmlcolumn of rows containing xml column having values 'abc' or 'xyz' in node 'user'().Below query i am using similar to IN option of sql. I want similar kind of query which does same work as sql 'NOT IN' does. That is in my case i want rows not having values 'abc' or 'xyz' in node 'user'() in xml column. So please help me on this. |
Posted: 13 Jul 2013 05:38 AM PDT I am developing a website whose functionality includes allowing user to submit some information to database. Sometimes users will want to save those info and submit them latter. So they will be written into database. Since these information have quite complicated structure(They uses several tables) it's kinda tricky to modify(Using alter lots of times) I wonder if it would be more efficient to delete the old info altogether and insert completely new info into database even though the new one and old one are largely the same? Thanks in advance! |
2NF relations of Normalization [on hold] Posted: 13 Jul 2013 02:11 AM PDT Is it possible to draw the ERD of 2NF to be 1:M diagram, because the question table is about Please help me and thank you! Table about reserving event |
Cassandra multidatacenter configuration with 1 external ip Posted: 13 Jul 2013 06:07 PM PDT I'm trying to setup a multi-datacenter Cassandra cluster. The problem is that my datacenters have only 1 external IP (wan IP), I can setup port forwarding on the data centers switchs to access each node from the outside world using a different port, but I don't know how to setup the cassandra.yaml file properly. Is there a way to setup a multidatacenter cassandra cluster in this scenario?. Thanks in advance! |
Dump PostgreSQL without DROP DATABASE Posted: 13 Jul 2013 03:58 AM PDT I want dump a database, but, without DROP DATABASE, and CREATE DATABASE instructions, in .backup / .sql (generate file). Actually I use this command: But, in top lines of file, I have this: So, I my case, I want duplicate this database, and, if I use this script with pg_restore I drop the other database (I don't want that). |
optimizing MySQL for traffic analytics system Posted: 13 Jul 2013 05:20 PM PDT background : I've developed a URL shortener system like Bitly with same features , so the system also tracks clickers info and represent as graphs to the person who has shorten the link as analytics data. currently I'm using MySQL and have a table to store click info with this schema: and for now , just the The system should represent click analytics in the time periods the user wants, for example past hour, past 24 hours , the past month , ... for example to generate graphs for past month , I do following queries: issues:
questions : 1- how to improve and optimize the structure , so the analytics of high traffic links will be shown in less than 1 second(like bitly and similar web apps) and with less usage of CPU and RAM ? should I make an index on the fields 2- is MySQL suitable for this application? assume at maximum my application should handle 100 million links and 10 billion clicks on them totally. Should I consider switching to an NoSQL solution for example? 3- if MySQL is ok , is my database design and table structure proper and well designed for my application needs? or you have better recommendations and suggestions? UPDATE: I made an index on column I think making index on these columns would not help to solve my problem, my idea is about one of these: 1- if using MySQL, maybe generating statistics using background processing for high traffic links is better instead of calculating lively at the user request. 2- using some caching solution like memcached to help MySQL with high traffic links. 3- using a NoSQL such as MongoDB and solutions like Map-Reduce which I am poorly familiar with and haven't used ever. what do you think? |
Posted: 13 Jul 2013 06:48 AM PDT I'm familiar with SSMS, but I've never used .net, c# or visual studio (been doing other things: Assembler, c, unix, vi, oracle, etc). I'm trying to figure out basic 2012 SSIS ETL (no BI or data warehouse) and can't find anything that explains how all of these fit together: catalog Say I just want to build a simple test using SSIS, import a file into a table, which of the above are required, and in what order do I create them? Also, do you have any good links to basic SSIS 2012 ETL overviews and/or how to articles. |
Posted: 13 Jul 2013 04:58 PM PDT In our current system, we query the LDAP using SQL Server 2008R2 but are moving to SQL Server 2012 where we have hit a snag. According to http://msdn.microsoft.com/en-us/library/cc707782.aspx one of the discontinued features of SQL Server 2012 is the AD helper service. Does anyone know of a way to query the AD from SQL Server 2012? |
Percona Xtrabackup on Suse EL 10 -- Failing Posted: 13 Jul 2013 05:58 AM PDT I have evaluated Percona Xtrabackup successfully and it works like a charm on my several CentOS / RHEL servers! Hats off to the team! But my problem starts when I tried to install this on one of my client's Suse EL 10 server. I believe Xtrabackup is not natively supported on Suse. But being an RPM based platform, I tried installing RHEL5 rpms from percona site. But they don't work. They install (a fairly older version 1.5.x) but when run they throw the error like Command I am running : /usr/bin/innobackupex --ibbackup=xtrabackup --defaults-file=/etc/my.cnf --user=some_user --password=password /root/backups Error shown is : innobackupex: fatal error: no 'mysqld' group in MySQL options I have made sure that my.cnf exist, it contains all necessary parametes like datadir / log files related parameters. See if you can help me with this and let me know if you need any more help / logs that I can provide. |
MySQL replication - slave update Posted: 13 Jul 2013 03:58 AM PDT I have a master slave setup of MySQL and my question is that if I make any changes in the slave database: |
Fulltext search limiting users possibilities Posted: 13 Jul 2013 07:57 PM PDT We have a web site with a search box. The search uses a fulltext index column. However, we just cant feed the text the user has input into this stored procedure. Searches with space in them fails, also there is a pletora of sql functions we do not want to expose to the users like and the like or binary operators like AND or OR. So we need to escape the term in some way. One way that immediately comes in mind is to put an AND between every word. However, it doesnt feel like thats a good solution. It reminds me to much about 1998 style coding. So is there any better suggestions? |
Having too many connection problem Posted: 13 Jul 2013 02:06 AM PDT We have an magento store and having 9K products and 2 store views the trouble is we are getting too many conection error while the site is in normal loads. 1) We have 100 connectoin open in mysql.
Many thanks |
Primary replica set server goes secondary after secondary fails Posted: 13 Jul 2013 04:26 PM PDT I have a 2 servers replica set that, after the secondary fails the primary goes into secondary mode while the secondary is in STARTUP2 (recovering). The problem with this is that I can't use the collection stored in that replica set freely, I'm getting errors trying to use the collection: Sometimes if I restart the mongod instances, the server rs2-1 is the primary for a while, but after some time (while the secondary is recovering) I see this in the logs of rs2-1 (the primary): Is there an easy way to make the primary keep being primary after the secondary fails? Am I doing something wrong? Thanks in advance! |
Posted: 13 Jul 2013 12:58 PM PDT I have a VoIP server running 24x7. At low peak hour at lease 150+ users are connected. My server has MySQL running with InnoDB engine on Windows 2008 platform. I like to take at least 2 times full database backup without shutting down my service. As per Peter Zaitsev - the founder of percona, mysqldump –single-transaction is not always good. read here if you are interested As I'm not a DBA, I like to know in my scenario, which would be best solution to take a database backup? Thanks, |
Strange characters in mysqlbinlog output Posted: 13 Jul 2013 10:58 AM PDT Has anyone experienced this? Data replicates fine but when output in mysqlbinlog there are hidden characters that break the input?
Thanks! Julie |
12c Grid Agent installation issues - Shell path is incorrect or not defined Posted: 13 Jul 2013 04:58 AM PDT I am installing 12c Grid Control agent on my server via Enterprise manager. The targer server is a UNIX server with AIX OS on it. I add target host manually, enter authentication information, host name, installation directory, etc. and all goes well untill I click "Deploy Agent" button, then I get the following error: "Shell path is incorrect or not defined.:/bin/bash(SH_PATH),-c(SH_ARGS) on host MyHostName" and details are : "Check the property values in the following files in this order, ssPaths_.properties or sPaths.properties or Paths.properties, in "/u02/app/oracle/middleware/oms/oui/prov/resources" There isn't /u02/app" directory on my target server, only /u01/app/oracle" so I assume the above directory is on the same server as Enterprise manager. Although I did find a directory where I have files of the format ssPaths_.properties - /u01/app/oracle/product/11.2.0.3/oui/prov/resources Since my platform ia AIX, I used file ssPaths_aix.properties On my target server if I run which bash I get /usr/bin/bash and which ssh returns /usr/bin/ssh ahd which sh returns /usr/bin/sh So I edited the ssPaths_aix.properties file so that SH_PATH=/usr/bin/sh but still getting the same error. I have also tried setting to SH_PATH=/usr/bin/bash but nothing seems to make any difference. I am thinking one possibility would be I am editing wrong file. Can anyone help? |
How to increase fast backup and restore of 500GB database using mysqldump? Posted: 13 Jul 2013 02:57 AM PDT There is a database A size of 500GB. Tables in database A contains both MyISAM and INNODB tables. MyISAM tables are master tables and Innodb tables are main transaction tables. Backup and restore using mysql dump taking quit a long time or days.
|
Connecting to a SQL Server database from a Flash program Posted: 13 Jul 2013 11:58 AM PDT I currently have the ability to utilize Microsoft SQL Server 2012. I am developing a project with Adobe Flash Builder 4.7. If I link my database with Adobe Flash Builder is there any additional steps I must take in order to make the database live, or as long as my computer is running will this database be accessible from any device that is utilizing it? In other words is this a LAN only system or does it automatically make itself available for the programs I link to it? |
Oracle Express edition on Ubuntu - control file missing Posted: 13 Jul 2013 05:58 PM PDT I have installed the Oracle Express edition on Ubuntu as mentioned here. I am facing issues when I try to create a sample table. Started oracle Started sqlplus Executed the CREATE command After a series of research on web, I tried to shutdown and restart oracle: Shutdown command Started the oracle instance I realized that the control file is missing at So I tried to create the control file as follows: Tried to create the sample table again So I tried to issue the following command What should be done next? I am clueless as I am not a database guy. Note: Output of |
How do I minimise logging during a large insert? Posted: 13 Jul 2013 01:23 PM PDT During a nightly scheduled task I am creating a large table from scratch using I'm happy to consider an alternative approach if that would help. |
You are subscribed to email updates from Recent Questions - Database Administrators Stack Exchange To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment